aboutsummaryrefslogtreecommitdiff
path: root/src/modules/random
diff options
context:
space:
mode:
authorEric Cheng <[email protected]>2022-12-06 18:13:51 -0500
committerGitHub <[email protected]>2022-12-07 00:13:51 +0100
commitc4b7ce8648cbd5ac2b224942908bccf9914e08f9 (patch)
tree82c0d99fe5c45cedb542ac05aaad3f2e8921df83 /src/modules/random
parent6bac476695c146a794b5337785979a7395d7dc89 (diff)
downloadfaker-c4b7ce8648cbd5ac2b224942908bccf9914e08f9.tar.xz
faker-c4b7ce8648cbd5ac2b224942908bccf9914e08f9.zip
refactor(string)!: swap `allowLeadingZeros` default to `true` (#1602)
Diffstat (limited to 'src/modules/random')
-rw-r--r--src/modules/random/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/random/index.ts b/src/modules/random/index.ts
index 21e46509..f8691198 100644
--- a/src/modules/random/index.ts
+++ b/src/modules/random/index.ts
@@ -262,7 +262,7 @@ export class RandomModule {
*
* @param length The number of digits to generate. Defaults to `1`.
* @param options The options to use. Defaults to `{}`.
- * @param options.allowLeadingZeros If true, leading zeros will be allowed. Defaults to `false`.
+ * @param options.allowLeadingZeros Whether leading zeros are allowed or not. Defaults to `true`.
* @param options.bannedDigits An array of digits which should be banned in the generated string. Defaults to `[]`.
*
* @see faker.string.numeric()
@@ -270,7 +270,7 @@ export class RandomModule {
* @example
* faker.random.numeric() // '2'
* faker.random.numeric(5) // '31507'
- * faker.random.numeric(42) // '56434563150765416546479875435481513188548'
+ * faker.random.numeric(42) // '00434563150765416546479875435481513188548'
* faker.random.numeric(42, { allowLeadingZeros: true }) // '00564846278453876543517840713421451546115'
* faker.random.numeric(6, { bannedDigits: ['0'] }) // '943228'
*