-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Continuation of #3287
The examples are inconsistently formatted, both in our source code and when running the refresh on the website.
- string without quotes:
faker/src/modules/finance/index.ts
Lines 126 to 128 in 00be2e1
* faker.finance.accountNumber() // 92842238 * faker.finance.accountNumber(5) // 28736 * faker.finance.accountNumber({ length: 5 }) // 32564 - single line string newline:
faker/src/modules/finance/index.ts
Lines 971 to 972 in 00be2e1
* faker.finance.transactionDescription() * // 'payment transaction at Emard LLC using card ending with ****9187 for HNL 506.57 in account ***2584.' - single line string inline:
faker/src/modules/food/index.ts
Line 43 in 3c7abb5
* faker.food.description() // 'An exquisite ostrich roast, infused with the essence of longan, slow-roasted to bring out its natural flavors and served with a side of creamy red cabbage' - array without leading/ending space:
faker/src/modules/helpers/index.ts
Line 821 in 3c7abb5
* faker.helpers.objectEntry({ prop1: 'value1', prop2: 'value2' }) // ['prop1', 'value1'] - array with leading/ending space:
faker/src/modules/helpers/index.ts
Line 619 in 3c7abb5
* faker.helpers.shuffle(['a', 'b', 'c']) // [ 'b', 'c', 'a' ]
Also some examples seem to refer to old parameter defaults or locale data as well.
We should define a function that formats our examples consistently.
Potentially automatically via script.