faker-js / faker

Generate massive amounts of fake data in the browser and node.js
https://fakerjs.dev
Other
13.08k stars 924 forks source link

faker.helpers.objectKey and faker.helpers.objectValue examples are not very instructive #3303

Open matthewmayer opened 5 hours ago

matthewmayer commented 5 hours ago
faker.helpers.objectKey({ myProperty: 'myValue' }) // 'myProperty'
faker.helpers.objectValue({ myProperty: 'myValue' }) // 'myValue'

we should use example objects with at least two key-values pairs so there is some randomness.

ST-DDT commented 5 hours ago

Maybe use {a:1, b: 2, c: 3} (or even allLocales)?

And while objectEntry has two entries, we should edit that for consistency as well.

https://fakerjs.dev/api/helpers.html#objectentry

matthewmayer commented 4 hours ago

Maybe something slightly more fun/memorable like {Cheetah: 120, Falcon: 390, Snail: 0.03} or {H: "Hydrogen", O: "Oxygen", C: "Carbon"}