diff options
Diffstat (limited to 'src/modules/location')
| -rw-r--r-- | src/modules/location/index.ts | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/modules/location/index.ts b/src/modules/location/index.ts index 217fe682..8fbbbe30 100644 --- a/src/modules/location/index.ts +++ b/src/modules/location/index.ts @@ -427,14 +427,16 @@ export class LocationModule extends ModuleBase { const { abbreviated = false } = options; if (!abbreviated) { - return this.faker.helpers.arrayElement( - this.faker.definitions.location.direction - ); + return this.faker.helpers.arrayElement([ + ...this.faker.definitions.location.direction.cardinal, + ...this.faker.definitions.location.direction.ordinal, + ]); } - return this.faker.helpers.arrayElement( - this.faker.definitions.location.direction_abbr - ); + return this.faker.helpers.arrayElement([ + ...this.faker.definitions.location.direction.cardinal_abbr, + ...this.faker.definitions.location.direction.ordinal_abbr, + ]); } /** @@ -465,12 +467,12 @@ export class LocationModule extends ModuleBase { if (!abbreviated) { return this.faker.helpers.arrayElement( - this.faker.definitions.location.direction.slice(0, 4) + this.faker.definitions.location.direction.cardinal ); } return this.faker.helpers.arrayElement( - this.faker.definitions.location.direction_abbr.slice(0, 4) + this.faker.definitions.location.direction.cardinal_abbr ); } @@ -502,12 +504,12 @@ export class LocationModule extends ModuleBase { if (!abbreviated) { return this.faker.helpers.arrayElement( - this.faker.definitions.location.direction.slice(4, 8) + this.faker.definitions.location.direction.ordinal ); } return this.faker.helpers.arrayElement( - this.faker.definitions.location.direction_abbr.slice(4, 8) + this.faker.definitions.location.direction.ordinal_abbr ); } |
