diff options
| author | Shinigami <[email protected]> | 2022-12-10 20:18:01 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-10 19:18:01 +0000 |
| commit | 7b50c2f0126ac865d4e4efea360b8ba71f0cb7c6 (patch) | |
| tree | 9ea854fb4bc1b4ae43d2ce1a409f5ea282961cb3 /src/modules/number | |
| parent | ab9fa1fe5bab671c1888663151ae20374f409c4a (diff) | |
| download | faker-7b50c2f0126ac865d4e4efea360b8ba71f0cb7c6.tar.xz faker-7b50c2f0126ac865d4e4efea360b8ba71f0cb7c6.zip | |
feat(number): adjust hex default (#1649)
Diffstat (limited to 'src/modules/number')
| -rw-r--r-- | src/modules/number/index.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/number/index.ts b/src/modules/number/index.ts index cef0b27c..62036ab1 100644 --- a/src/modules/number/index.ts +++ b/src/modules/number/index.ts @@ -117,12 +117,12 @@ export class NumberModule { * * @param options Maximum value or options object. Defaults to `{}`. * @param options.min Lower bound for generated number. Defaults to `0`. - * @param options.max Upper bound for generated number. Defaults to `min + 16`. + * @param options.max Upper bound for generated number. Defaults to `15`. * * @example * faker.number.hex() // 'b' - * faker.number.hex(16) // '9' - * faker.number.hex({ min: 0, max: 65536 }) // 'af17' + * faker.number.hex(255) // '9d' + * faker.number.hex({ min: 0, max: 65535 }) // 'af17' * * @since 8.0.0 */ @@ -131,7 +131,7 @@ export class NumberModule { options = { max: options }; } - const { min = 0, max = min + 16 } = options; + const { min = 0, max = 15 } = options; return this.int({ max, |
