Closed beebase closed 6 years ago
ah ok, that would be:
first: {
eval: 'chance.first({gender: "female"})'
},
Hi, sorry for the delay and thank you for open an issue. In order to increase the performance of the generator I have to remove the auto-eval inside the generators, so to activate the old eval you have to pass ´eval:true´, feel free to try on the playgroud
first: {
chance: 'first({gender: "female"})',
eval: true
},
Sorry, for reopen, I check the parser function and maybe there is an error, you can use that way also:
first: {
chance: 'first({"gender": "female"})'
},
Im going to check if there is an error or not, stay tunned
Yes, there is no error, maybe in future versions I can improve that, right now my parser users JSON.parse to parse objects inside the function, so for doing that without eval first({"gender": "female"})
you have to use exact JSON syntax in {"gender": "female"}
.
Or always you can use eval, but if you have a lot of data to generate is better not use eval.
Feel free also to submit pull requests to improve the parser funciton, the parser function is inside -> src/lib/utils.ts line:133
Thanks and sorry for the inconvenience!
Is this possible?