Skip to content

Commit

Permalink
feat: add rodent breed on animal 'en' locale (#1136)
Browse files Browse the repository at this point in the history
  • Loading branch information
LordFitoi committed Jul 30, 2022
1 parent fc48155 commit a65f1a2
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/definitions/animal.ts
Expand Up @@ -16,6 +16,7 @@ export type AnimalDefinitions = LocaleEntry<{
insect: string[];
lion: string[];
rabbit: string[];
rodent: string[];
snake: string[];
type: string[];
}>;
2 changes: 2 additions & 0 deletions src/locales/en/animal/index.ts
Expand Up @@ -15,6 +15,7 @@ import horse from './horse';
import insect from './insect';
import lion from './lion';
import rabbit from './rabbit';
import rodent from './rodent';
import snake from './snake';
import type_ from './type';

Expand All @@ -31,6 +32,7 @@ const animal: AnimalDefinitions = {
insect,
lion,
rabbit,
rodent,
snake,
type: type_,
};
Expand Down
187 changes: 187 additions & 0 deletions src/locales/en/animal/rodent.ts
@@ -0,0 +1,187 @@
export default [
'Abrocoma',
'Abrocoma schistacea',
'Aconaemys',
'Aconaemys porteri',
'African brush-tailed porcupine',
'Andean mountain cavy',
'Argentine tuco-tuco',
'Ashy chinchilla rat',
'Asiatic brush-tailed porcupine',
'Atherurus',
"Azara's agouti",
"Azara's tuco-tuco",
'Bahia porcupine',
'Bathyergus',
'Bathyergus janetta',
'Bathyergus suillus',
"Bennett's chinchilla rat",
'Bicolored-spined porcupine',
'Black agouti',
'Black dwarf porcupine',
'Black-rumped agouti',
'Black-tailed hairy dwarf porcupine',
'Bolivian chinchilla rat',
'Bolivian tuco-tuco',
"Bonetto's tuco-tuco",
"Brandt's yellow-toothed cavy",
'Brazilian guinea pig',
'Brazilian porcupine',
'Brazilian tuco-tuco',
"Bridge's degu",
'Brown hairy dwarf porcupine',
"Budin's chinchilla rat, A. budini",
'Cape porcupine',
'Catamarca tuco-tuco',
'Cavia',
'Central American agouti',
'Chacoan tuco-tuco',
'Chilean rock rat',
'Chinchilla',
'Coendou',
'Coiban agouti',
"Colburn's tuco-tuco",
'Collared tuco-tuco',
'Common degu',
'Common yellow-toothed cavy',
"Conover's tuco-tuco",
'Coruro',
'Crested agouti',
'Crested porcupine',
'Cryptomys',
'Cryptomys bocagei',
'Cryptomys damarensis',
'Cryptomys foxi',
'Cryptomys hottentotus',
'Cryptomys mechowi',
'Cryptomys ochraceocinereus',
'Cryptomys zechi',
'Ctenomys',
'Cuniculus',
'Cuscomys',
'Cuscomys ashanika',
'Dactylomys',
'Dactylomys boliviensis',
'Dactylomys dactylinus',
'Dactylomys peruanus',
'Dasyprocta',
'Domestic guinea pig',
"Emily's tuco-tuco",
'Erethizon',
'Famatina chinchilla rat',
'Frosted hairy dwarf porcupine',
'Fukomys',
'Fukomys amatus',
'Fukomys anselli',
'Fukomys bocagei',
'Fukomys damarensis',
'Fukomys darlingi',
'Fukomys foxi',
'Fukomys ilariae',
'Fukomys kafuensis',
'Fukomys mechowii',
'Fukomys micklemi',
'Fukomys occlusus',
'Fukomys ochraceocinereus',
'Fukomys whytei',
'Fukomys zechi',
'Furtive tuco-tuco',
'Galea',
'Georychus',
'Georychus capensis',
'Golden viscacha-rat',
'Goya tuco-tuco',
'Greater guinea pig',
'Green acouchi',
"Haig's tuco-tuco",
'Heliophobius',
'Heliophobius argenteocinereus',
'Heterocephalus',
'Heterocephalus glaber',
'Highland tuco-tuco',
'Hystrix',
'Indian porcupine',
'Isla Mocha degu',
'Kalinowski agouti',
'Kannabateomys',
'Kannabateomys amblyonyx',
'Lagidium',
'Lagostomus',
"Lewis' tuco-tuco",
'Long-tailed chinchilla',
'Long-tailed porcupine',
"Los Chalchaleros' viscacha-rat",
'Lowland paca',
'Magellanic tuco-tuco',
'Malayan porcupine',
'Maule tuco-tuco',
'Mendoza tuco-tuco',
'Mexican agouti',
'Mexican hairy dwarf porcupine',
'Microcavia',
'Montane guinea pig',
'Moon-toothed degu',
'Mottled tuco-tuco',
'Mountain degu',
'Mountain paca',
'Mountain viscacha-rat',
'Myoprocta',
"Natterer's tuco-tuco",
'North American porcupine',
'Northern viscacha',
'Octodon',
'Octodontomys',
'Octomys',
'Olallamys',
'Olallamys albicauda',
'Olallamys edax',
'Orinoco agouti',
'Paraguaian hairy dwarf porcupine',
"Pearson's tuco-tuco",
'Peruvian tuco-tuco',
'Philippine porcupine',
'Pipanacoctomys',
'Plains viscacha',
'Plains viscacha-rat',
"Porteous' tuco-tuco",
'Punta de Vacas chinchilla rat',
'Red acouchi',
'Red-rumped agouti',
'Reddish tuco-tuco',
'Rio Negro tuco-tuco',
'Robust tuco-tuco',
"Roosmalen's dwarf porcupine",
"Rothschild's porcupine",
'Ruatan Island agouti',
"Sage's rock rat",
'Salinoctomys',
'Salta tuco-tuco',
'San Luis tuco-tuco',
"Santa Catarina's guinea pig",
'Shiny guinea pig',
"Shipton's mountain cavy",
'Short-tailed chinchilla',
'Silky tuco-tuco',
'Social tuco-tuco',
'Southern mountain cavy',
'Southern tuco-tuco',
'Southern viscacha',
'Spalacopus',
"Spix's yellow-toothed cavy",
"Steinbach's tuco-tuco",
'Streaked dwarf porcupine',
'Strong tuco-tuco',
'Stump-tailed porcupine',
'Sumatran porcupine',
'Sunda porcupine',
'Talas tuco-tuco',
'Tawny tuco-tuco',
'Thick-spined porcupine',
'Tiny tuco-tuco',
'Trichys',
'Tucuman tuco-tuco',
'Tympanoctomys',
'Uspallata chinchilla rat',
'White-toothed tuco-tuco',
"Wolffsohn's viscacha",
];
12 changes: 12 additions & 0 deletions src/modules/animal/index.ts
Expand Up @@ -152,6 +152,18 @@ export class Animal {
);
}

/**
* Returns a random rodent breed.
*
* @example
* faker.animal.rodent() // 'Cuscomys ashanika'
*/
rodent(): string {
return this.faker.helpers.arrayElement(
this.faker.definitions.animal.rodent
);
}

/**
* Returns a random animal type.
*
Expand Down
6 changes: 6 additions & 0 deletions test/__snapshots__/animal.spec.ts.snap
Expand Up @@ -24,6 +24,8 @@ exports[`animal > 42 > lion 1`] = `"West African Lion"`;

exports[`animal > 42 > rabbit 1`] = `"English Spot"`;

exports[`animal > 42 > rodent 1`] = `"Famatina chinchilla rat"`;

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

exports[`animal > 42 > type 1`] = `"lion"`;
Expand Down Expand Up @@ -52,6 +54,8 @@ exports[`animal > 1211 > lion 1`] = `"Cape lion"`;

exports[`animal > 1211 > rabbit 1`] = `"Silver Marten"`;

exports[`animal > 1211 > rodent 1`] = `"Strong tuco-tuco"`;

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

exports[`animal > 1211 > type 1`] = `"horse"`;
Expand Down Expand Up @@ -80,6 +84,8 @@ exports[`animal > 1337 > lion 1`] = `"Barbary Lion"`;

exports[`animal > 1337 > rabbit 1`] = `"Cinnamon"`;

exports[`animal > 1337 > rodent 1`] = `"Crested porcupine"`;

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

exports[`animal > 1337 > type 1`] = `"bear"`;
1 change: 1 addition & 0 deletions test/animal.spec.ts
Expand Up @@ -17,6 +17,7 @@ const functionNames = [
'insect',
'lion',
'rabbit',
'rodent',
'snake',
'type',
] as const;
Expand Down

0 comments on commit a65f1a2

Please sign in to comment.