diff options
| author | Shinigami <[email protected]> | 2022-12-31 12:22:38 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-31 12:22:38 +0100 |
| commit | 2d93e6f14a5ba976f87b71202bc4e011e38ee823 (patch) | |
| tree | 09c569ac0aa920ba090667a938f67416134dca26 /src/modules/location | |
| parent | e296ff2d4f6f1aa56fe7c80722257bd0b316b30a (diff) | |
| download | faker-2d93e6f14a5ba976f87b71202bc4e011e38ee823.tar.xz faker-2d93e6f14a5ba976f87b71202bc4e011e38ee823.zip | |
chore: turn on padding-line-between-statements (#1691)
Diffstat (limited to 'src/modules/location')
| -rw-r--r-- | src/modules/location/index.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/modules/location/index.ts b/src/modules/location/index.ts index a53c11d7..4e25cbb9 100644 --- a/src/modules/location/index.ts +++ b/src/modules/location/index.ts @@ -10,6 +10,7 @@ export class LocationModule { if (name === 'constructor' || typeof this[name] !== 'function') { continue; } + this[name] = this[name].bind(this); } } @@ -39,6 +40,7 @@ export class LocationModule { format = this.faker.helpers.arrayElement(localeFormat); } } + return this.faker.helpers.replaceSymbols(format); } @@ -62,6 +64,7 @@ export class LocationModule { if (zipRange) { return String(this.faker.number.int(zipRange)); } + return this.zipCode(); } @@ -309,6 +312,7 @@ export class LocationModule { this.faker.definitions.location.direction ); } + return this.faker.helpers.arrayElement( this.faker.definitions.location.direction_abbr ); @@ -333,6 +337,7 @@ export class LocationModule { this.faker.definitions.location.direction.slice(0, 4) ); } + return this.faker.helpers.arrayElement( this.faker.definitions.location.direction_abbr.slice(0, 4) ); @@ -357,6 +362,7 @@ export class LocationModule { this.faker.definitions.location.direction.slice(4, 8) ); } + return this.faker.helpers.arrayElement( this.faker.definitions.location.direction_abbr.slice(4, 8) ); @@ -419,6 +425,7 @@ export class LocationModule { newCoordinate[0] = Math.sign(newCoordinate[0]) * 180 - newCoordinate[0]; newCoordinate[1] += 180; } + // Box longitude [-180°, 180°] newCoordinate[1] = (((newCoordinate[1] % 360) + 540) % 360) - 180; |
