diff options
| author | KeisukeYamashita <[email protected]> | 2024-04-06 19:58:17 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-06 19:58:17 +0200 |
| commit | 501f4b3d3a8056b8b7877f1d78575ade26b361ce (patch) | |
| tree | 524a2f52c97f03a8fbe78df1e8c74305eb6c7d94 /src | |
| parent | f47dfe5c58371b468c704cab7a7cd29f9a3e3379 (diff) | |
| download | faker-501f4b3d3a8056b8b7877f1d78575ade26b361ce.tar.xz faker-501f4b3d3a8056b8b7877f1d78575ade26b361ce.zip | |
feat(locale): support street and street address for ja (#2193)
Diffstat (limited to 'src')
| -rw-r--r-- | src/locales/ja/location/index.ts | 4 | ||||
| -rw-r--r-- | src/locales/ja/location/secondary_address.ts | 1 | ||||
| -rw-r--r-- | src/locales/ja/location/street_address.ts | 4 | ||||
| -rw-r--r-- | src/locales/ja/location/street_pattern.ts | 3 | ||||
| -rw-r--r-- | src/modules/location/index.ts | 2 |
5 files changed, 11 insertions, 3 deletions
diff --git a/src/locales/ja/location/index.ts b/src/locales/ja/location/index.ts index 7f5d9e65..1d9b9aae 100644 --- a/src/locales/ja/location/index.ts +++ b/src/locales/ja/location/index.ts @@ -9,8 +9,10 @@ import city_suffix from './city_suffix'; import country from './country'; import direction from './direction'; import postcode from './postcode'; +import secondary_address from './secondary_address'; import state from './state'; import state_abbr from './state_abbr'; +import street_address from './street_address'; import street_pattern from './street_pattern'; const location: LocationDefinition = { @@ -20,8 +22,10 @@ const location: LocationDefinition = { country, direction, postcode, + secondary_address, state, state_abbr, + street_address, street_pattern, }; diff --git a/src/locales/ja/location/secondary_address.ts b/src/locales/ja/location/secondary_address.ts new file mode 100644 index 00000000..2146358c --- /dev/null +++ b/src/locales/ja/location/secondary_address.ts @@ -0,0 +1 @@ +export default ['{{person.last_name}}###号室']; diff --git a/src/locales/ja/location/street_address.ts b/src/locales/ja/location/street_address.ts new file mode 100644 index 00000000..296fae56 --- /dev/null +++ b/src/locales/ja/location/street_address.ts @@ -0,0 +1,4 @@ +export default { + normal: '{{location.street}}', + full: '{{location.street}} {{location.secondaryAddress}}', +}; diff --git a/src/locales/ja/location/street_pattern.ts b/src/locales/ja/location/street_pattern.ts index 06ca3a5e..b4c30463 100644 --- a/src/locales/ja/location/street_pattern.ts +++ b/src/locales/ja/location/street_pattern.ts @@ -1,4 +1,3 @@ export default [ - '{{person.first_name}}{{location.street_suffix}}', - '{{person.last_name}}{{location.street_suffix}}', + '{{number.int({"max": 9, "min": 1})}}丁目{{number.int({"max": 9, "min": 1})}}番{{number.int({"max": 9, "min": 1})}}号', ]; diff --git a/src/modules/location/index.ts b/src/modules/location/index.ts index 2553e50d..217fe682 100644 --- a/src/modules/location/index.ts +++ b/src/modules/location/index.ts @@ -176,7 +176,7 @@ export class LocationModule extends ModuleBase { */ secondaryAddress(): string { return this.faker.helpers - .arrayElement(this.faker.definitions.location.secondary_address) + .fake(this.faker.definitions.location.secondary_address) .replaceAll(/#+/g, (m) => this.faker.string.numeric({ length: m.length, |
