You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{en,Faker,Randomizer,zh_TW,generateDefaultRandomizer}from'@faker-js/faker';constrandomizer: Randomizer=generateDefaultRandomizer()constcustomFakerEN=newFaker({locale: en,
randomizer,});constcustomFakerZH_TW=newFaker({locale: [zh_TW,en],
randomizer,});randomizer.seed(5);// customFakerEN.seed(5); // Redundant// customFakerZH_TW.seed(5); // RedundantconstfirstName=fakerZH_TW.person.firstName();// 炫明constalias=fakerEN.person.firstName();// John (different from before, because it is now the second call)
The text was updated successfully, but these errors were encountered:
Clear and concise description of the problem
Injecting the same randomizer to different Faker instances seems to become a common use case, especially with multilingual datasets.
Hovewer, the default randomizer factory is not exported from the package and therefore cannot easily be used.
Suggested solution
It would be really helpful if the method
generateMersenne32Randomizer
was exported, maybe using an alias.The documentation could be updated as follows:
The text was updated successfully, but these errors were encountered: