I'm using faker to generate random data for local development, great stuff. Some of the data that I generate is logically connected, like a currency isocode and symbol.
I'm currently doing the following:
{
isocode: faker.finance.currencyCode(),
symbol: faker.finance.currencySymbol()
}
Which can result in an object with conficting values, such as:
{
isocode: 'USD',
symbol: '€'
}
It would be great to have support for random data for not just a single value, but for a whole object instead.
Something like:
const finance = faker.finance();
{
isocode: finance.currencyCode(),
symbol: finance.currencySymbol()
}
???
@Marak I've updated the text a bit, but let me know if there's something unclear.
What else requires logically mappings besides currency code and currency symbol?
Not a whole lot I guess, but I can image a few like currency:
Also related, but less related are:
postal code and state/city
@tobi-or-not-tobi
I can see the case for currency, country, and phone number having logical mappings to their respective pairs. I think name / email / domain name may already have the ability to pass a context as function arguments to provide contextual results.
This seems like something that could be improved in faker but should further discussed and planned. There might be other areas of the API that would benefit from this.
A pull request for currency codes might be a good start for now.
Related #68 #115
language / isocode would be another one.
@Marak can you review the PR?
Most helpful comment
Not a whole lot I guess, but I can image a few like currency:
Also related, but less related are: