@@ -22,7 +22,9 @@ export class AnimalModule extends ModuleBase {
2222 * @since 5.5.0
2323 */
2424 dog ( ) : string {
25- return this . faker . helpers . arrayElement ( this . faker . definitions . animal . dog ) ;
25+ return this . faker . helpers . arrayElement (
26+ assertLocaleData ( this . faker . fakerCore . locale . animal ?. dog , 'animal.dog' )
27+ ) ;
2628 }
2729
2830 /**
@@ -34,7 +36,9 @@ export class AnimalModule extends ModuleBase {
3436 * @since 5.5.0
3537 */
3638 cat ( ) : string {
37- return this . faker . helpers . arrayElement ( this . faker . definitions . animal . cat ) ;
39+ return this . faker . helpers . arrayElement (
40+ assertLocaleData ( this . faker . fakerCore . locale . animal ?. cat , 'animal.cat' )
41+ ) ;
3842 }
3943
4044 /**
@@ -46,7 +50,12 @@ export class AnimalModule extends ModuleBase {
4650 * @since 5.5.0
4751 */
4852 snake ( ) : string {
49- return this . faker . helpers . arrayElement ( this . faker . definitions . animal . snake ) ;
53+ return this . faker . helpers . arrayElement (
54+ assertLocaleData (
55+ this . faker . fakerCore . locale . animal ?. snake ,
56+ 'animal.snake'
57+ )
58+ ) ;
5059 }
5160
5261 /**
@@ -58,7 +67,9 @@ export class AnimalModule extends ModuleBase {
5867 * @since 5.5.0
5968 */
6069 bear ( ) : string {
61- return this . faker . helpers . arrayElement ( this . faker . definitions . animal . bear ) ;
70+ return this . faker . helpers . arrayElement (
71+ assertLocaleData ( this . faker . fakerCore . locale . animal ?. bear , 'animal.bear' )
72+ ) ;
6273 }
6374
6475 /**
@@ -70,7 +81,9 @@ export class AnimalModule extends ModuleBase {
7081 * @since 5.5.0
7182 */
7283 lion ( ) : string {
73- return this . faker . helpers . arrayElement ( this . faker . definitions . animal . lion ) ;
84+ return this . faker . helpers . arrayElement (
85+ assertLocaleData ( this . faker . fakerCore . locale . animal ?. lion , 'animal.lion' )
86+ ) ;
7487 }
7588
7689 /**
@@ -83,7 +96,10 @@ export class AnimalModule extends ModuleBase {
8396 */
8497 cetacean ( ) : string {
8598 return this . faker . helpers . arrayElement (
86- this . faker . definitions . animal . cetacean
99+ assertLocaleData (
100+ this . faker . fakerCore . locale . animal ?. cetacean ,
101+ 'animal.cetacean'
102+ )
87103 ) ;
88104 }
89105
@@ -96,7 +112,12 @@ export class AnimalModule extends ModuleBase {
96112 * @since 5.5.0
97113 */
98114 horse ( ) : string {
99- return this . faker . helpers . arrayElement ( this . faker . definitions . animal . horse ) ;
115+ return this . faker . helpers . arrayElement (
116+ assertLocaleData (
117+ this . faker . fakerCore . locale . animal ?. horse ,
118+ 'animal.horse'
119+ )
120+ ) ;
100121 }
101122
102123 /**
@@ -108,7 +129,9 @@ export class AnimalModule extends ModuleBase {
108129 * @since 5.5.0
109130 */
110131 bird ( ) : string {
111- return this . faker . helpers . arrayElement ( this . faker . definitions . animal . bird ) ;
132+ return this . faker . helpers . arrayElement (
133+ assertLocaleData ( this . faker . fakerCore . locale . animal ?. bird , 'animal.bird' )
134+ ) ;
112135 }
113136
114137 /**
@@ -120,7 +143,9 @@ export class AnimalModule extends ModuleBase {
120143 * @since 5.5.0
121144 */
122145 cow ( ) : string {
123- return this . faker . helpers . arrayElement ( this . faker . definitions . animal . cow ) ;
146+ return this . faker . helpers . arrayElement (
147+ assertLocaleData ( this . faker . fakerCore . locale . animal ?. cow , 'animal.cow' )
148+ ) ;
124149 }
125150
126151 /**
@@ -132,7 +157,9 @@ export class AnimalModule extends ModuleBase {
132157 * @since 5.5.0
133158 */
134159 fish ( ) : string {
135- return this . faker . helpers . arrayElement ( this . faker . definitions . animal . fish ) ;
160+ return this . faker . helpers . arrayElement (
161+ assertLocaleData ( this . faker . fakerCore . locale . animal ?. fish , 'animal.fish' )
162+ ) ;
136163 }
137164
138165 /**
@@ -145,7 +172,10 @@ export class AnimalModule extends ModuleBase {
145172 */
146173 crocodilia ( ) : string {
147174 return this . faker . helpers . arrayElement (
148- this . faker . definitions . animal . crocodilia
175+ assertLocaleData (
176+ this . faker . fakerCore . locale . animal ?. crocodilia ,
177+ 'animal.crocodilia'
178+ )
149179 ) ;
150180 }
151181
@@ -159,7 +189,10 @@ export class AnimalModule extends ModuleBase {
159189 */
160190 insect ( ) : string {
161191 return this . faker . helpers . arrayElement (
162- this . faker . definitions . animal . insect
192+ assertLocaleData (
193+ this . faker . fakerCore . locale . animal ?. insect ,
194+ 'animal.insect'
195+ )
163196 ) ;
164197 }
165198
@@ -173,7 +206,10 @@ export class AnimalModule extends ModuleBase {
173206 */
174207 rabbit ( ) : string {
175208 return this . faker . helpers . arrayElement (
176- this . faker . definitions . animal . rabbit
209+ assertLocaleData (
210+ this . faker . fakerCore . locale . animal ?. rabbit ,
211+ 'animal.rabbit'
212+ )
177213 ) ;
178214 }
179215
@@ -187,7 +223,10 @@ export class AnimalModule extends ModuleBase {
187223 */
188224 rodent ( ) : string {
189225 return this . faker . helpers . arrayElement (
190- this . faker . definitions . animal . rodent
226+ assertLocaleData (
227+ this . faker . fakerCore . locale . animal ?. rodent ,
228+ 'animal.rodent'
229+ )
191230 ) ;
192231 }
193232
@@ -200,7 +239,9 @@ export class AnimalModule extends ModuleBase {
200239 * @since 5.5.0
201240 */
202241 type ( ) : string {
203- return this . faker . helpers . arrayElement ( this . faker . definitions . animal . type ) ;
242+ return this . faker . helpers . arrayElement (
243+ assertLocaleData ( this . faker . fakerCore . locale . animal ?. type , 'animal.type' )
244+ ) ;
204245 }
205246
206247 /**
@@ -213,7 +254,10 @@ export class AnimalModule extends ModuleBase {
213254 */
214255 petName ( ) : string {
215256 return this . faker . helpers . arrayElement (
216- this . faker . definitions . animal . pet_name
257+ assertLocaleData (
258+ this . faker . fakerCore . locale . animal ?. pet_name ,
259+ 'animal.pet_name'
260+ )
217261 ) ;
218262 }
219263}
0 commit comments