diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/location/index.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/location/index.ts b/src/modules/location/index.ts index cdfa44d0..175c5433 100644 --- a/src/modules/location/index.ts +++ b/src/modules/location/index.ts @@ -65,10 +65,11 @@ export class LocationModule { const { state } = options; if (state) { - const zipRange = this.faker.definitions.location.postcode_by_state[state]; + const zipPattern: string = + this.faker.definitions.location.postcode_by_state[state]; - if (zipRange) { - return String(this.faker.number.int(zipRange)); + if (zipPattern) { + return this.faker.helpers.fake(zipPattern); } throw new FakerError(`No zip code definition found for state "${state}"`); |
