File tree Expand file tree Collapse file tree 4 files changed +12
-1
lines changed
Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ interface OptionsUrl {
5858 protocol ?: string ;
5959 tld ?: string ;
6060}
61+ interface OptionsGame {
62+ locale ?: string ;
63+ }
6164interface OptionsFaker {
6265 locale ?: string ;
6366}
@@ -83,5 +86,6 @@ declare class Faker {
8386 email ( options ?: OptionsEmail ) : string ;
8487 firstName ( options ?: OptionsFirstname ) : string ;
8588 lastName ( options ?: OptionsLastname ) : string ;
89+ game ( options ?: OptionsGame ) : string ;
8690}
8791export default function faker ( options ?: OptionsFaker ) : Faker ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import browser from '@fakerjs/browser';
1919import email from '@fakerjs/email' ;
2020import firstName from '@fakerjs/firstname' ;
2121import lastName from '@fakerjs/lastname' ;
22+ import game from '@fakerjs/game' ;
2223
2324class Faker {
2425 options = { } ;
@@ -67,6 +68,10 @@ class Faker {
6768 return animal ( { locale : this . options . locale || 'en_US' , ...options } ) ;
6869 }
6970
71+ game ( options ) {
72+ return game ( { locale : this . options . locale || 'en_US' , ...options } ) ;
73+ }
74+
7075 superhero ( ) {
7176 return superhero ( ) ;
7277 }
Original file line number Diff line number Diff line change @@ -22,3 +22,4 @@ expectType<string>(faker().browser());
2222expectType < string > ( faker ( ) . email ( ) ) ;
2323expectType < string > ( faker ( ) . firstName ( ) ) ;
2424expectType < string > ( faker ( ) . lastName ( ) ) ;
25+ expectType < string > ( faker ( ) . game ( ) . title ( ) ) ;
Original file line number Diff line number Diff line change 5858 "@fakerjs/url" : " ^1" ,
5959 "@fakerjs/email" : " ^1" ,
6060 "@fakerjs/firstname" : " ^1" ,
61- "@fakerjs/lastname" : " ^1"
61+ "@fakerjs/lastname" : " ^1" ,
62+ "@fakerjs/game" : " ^1"
6263 }
6364}
You can’t perform that action at this time.
0 commit comments