Skip to content

Commit

Permalink
Merge branch 'next' into refactor-remove-deprecated-locale-aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored Apr 7, 2024
2 parents 21cb535 + 501f4b3 commit 25a822c
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 16 deletions.
49 changes: 40 additions & 9 deletions src/locales/en/animal/type.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,46 @@
export default [
'dog',
'cat',
'snake',
'bat',
'bear',
'lion',
'cetacean',
'insect',
'crocodilia',
'cow',
'bee',
'bird',
'butterfly',
'cat',
'cow',
'crocodile',
'deer',
'dog',
'dolphin',
'eagle',
'elephant',
'fish',
'rabbit',
'flamingo',
'fox',
'frog',
'gecko',
'giraffe',
'gorilla',
'hamster',
'hippopotamus',
'horse',
'kangaroo',
'koala',
'lion',
'monkey',
'ostrich',
'panda',
'parrot',
'peacock',
'penguin',
'polar bear',
'rabbit',
'rhinoceros',
'sea lion',
'shark',
'snake',
'squirrel',
'tiger',
'turtle',
'whale',
'wolf',
'zebra',
];
4 changes: 4 additions & 0 deletions src/locales/ja/location/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -20,8 +22,10 @@ const location: LocationDefinition = {
country,
direction,
postcode,
secondary_address,
state,
state_abbr,
street_address,
street_pattern,
};

Expand Down
1 change: 1 addition & 0 deletions src/locales/ja/location/secondary_address.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default ['{{person.last_name}}###号室'];
4 changes: 4 additions & 0 deletions src/locales/ja/location/street_address.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
normal: '{{location.street}}',
full: '{{location.street}} {{location.secondaryAddress}}',
};
3 changes: 1 addition & 2 deletions src/locales/ja/location/street_pattern.ts
Original file line number Diff line number Diff line change
@@ -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})}}号',
];
2 changes: 1 addition & 1 deletion src/modules/animal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export class AnimalModule extends ModuleBase {
* Returns a random animal type.
*
* @example
* faker.animal.type() // 'crocodilia'
* faker.animal.type() // 'crocodile'
*
* @since 5.5.0
*/
Expand Down
2 changes: 1 addition & 1 deletion src/modules/location/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions test/modules/__snapshots__/animal.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports[`animal > 42 > rodent 1`] = `"Famatina chinchilla rat"`;

exports[`animal > 42 > snake 1`] = `"Grey-banded kingsnake"`;

exports[`animal > 42 > type 1`] = `"lion"`;
exports[`animal > 42 > type 1`] = `"frog"`;

exports[`animal > 1211 > bear 1`] = `"Polar bear"`;

Expand Down Expand Up @@ -58,7 +58,7 @@ exports[`animal > 1211 > rodent 1`] = `"Strong tuco-tuco"`;

exports[`animal > 1211 > snake 1`] = `"Tiger pit viper"`;

exports[`animal > 1211 > type 1`] = `"horse"`;
exports[`animal > 1211 > type 1`] = `"turtle"`;

exports[`animal > 1337 > bear 1`] = `"Sun bear"`;

Expand Down Expand Up @@ -88,4 +88,4 @@ exports[`animal > 1337 > rodent 1`] = `"Crested porcupine"`;

exports[`animal > 1337 > snake 1`] = `"Eastern coral snake"`;

exports[`animal > 1337 > type 1`] = `"bear"`;
exports[`animal > 1337 > type 1`] = `"eagle"`;

0 comments on commit 25a822c

Please sign in to comment.