aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorDivisionByZero <[email protected]>2023-12-04 08:21:09 +0100
committerGitHub <[email protected]>2023-12-04 08:21:09 +0100
commit9459f2dd0066500d7e6994d6d96d0952a795d509 (patch)
tree7cc1cdd5e3868ee827783055981aeebdc512122b /src/modules
parent505f659e4359a39b6e7949209071ba663b751151 (diff)
downloadfaker-9459f2dd0066500d7e6994d6d96d0952a795d509.tar.xz
faker-9459f2dd0066500d7e6994d6d96d0952a795d509.zip
docs: add missing throw descriptions in JSDocs (#2560)
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/datatype/index.ts6
-rw-r--r--src/modules/number/index.ts17
2 files changed, 17 insertions, 6 deletions
diff --git a/src/modules/datatype/index.ts b/src/modules/datatype/index.ts
index f46cfc0b..b8830610 100644
--- a/src/modules/datatype/index.ts
+++ b/src/modules/datatype/index.ts
@@ -20,7 +20,8 @@ export class DatatypeModule extends SimpleModuleBase {
* @param options.max Upper bound for generated number. Defaults to `min + 99999`.
* @param options.precision Precision of the generated number. Defaults to `1`.
*
- * @throws When options define `max < min`.
+ * @throws When `min` is greater than `max`.
+ * @throws When `precision` is negative.
*
* @see faker.number.int(): For generating a random integer.
* @see faker.number.float(): For generating a random floating-point number.
@@ -85,6 +86,9 @@ export class DatatypeModule extends SimpleModuleBase {
* @param options.max Upper bound for generated number. Defaults to `min + 99999`.
* @param options.precision Precision of the generated number. Defaults to `0.01`.
*
+ * @throws When `min` is greater than `max`.
+ * @throws When `precision` is negative.
+ *
* @see faker.number.float(): For the replacement method.
*
* @example
diff --git a/src/modules/number/index.ts b/src/modules/number/index.ts
index a20a0040..91d98777 100644
--- a/src/modules/number/index.ts
+++ b/src/modules/number/index.ts
@@ -24,7 +24,8 @@ export class NumberModule extends SimpleModuleBase {
* @param options.min Lower bound for generated number. Defaults to `0`.
* @param options.max Upper bound for generated number. Defaults to `Number.MAX_SAFE_INTEGER`.
*
- * @throws When options define `max < min`.
+ * @throws When `min` is greater than `max`.
+ * @throws When there are no integers between `min` and `max`.
*
* @see faker.string.numeric(): For generating a `string` of digits with a given length (range).
*
@@ -93,6 +94,9 @@ export class NumberModule extends SimpleModuleBase {
* @param options.precision Precision of the generated number, for example `0.01` will round to 2 decimal points.
* If precision is passed, the upper bound is inclusive.
*
+ * @throws When `min` is greater than `max`.
+ * @throws When `precision` is negative.
+ *
* @example
* faker.number.float() // 0.5688541042618454
* faker.number.float(3) // 2.367973240558058
@@ -168,7 +172,8 @@ export class NumberModule extends SimpleModuleBase {
* @param options.min Lower bound for generated number. Defaults to `0`.
* @param options.max Upper bound for generated number. Defaults to `1`.
*
- * @throws When options define `max < min`.
+ * @throws When `min` is greater than `max`.
+ * @throws When there are no integers between `min` and `max`.
*
* @see faker.string.binary(): For generating a `binary string` with a given length (range).
*
@@ -217,7 +222,8 @@ export class NumberModule extends SimpleModuleBase {
* @param options.min Lower bound for generated number. Defaults to `0`.
* @param options.max Upper bound for generated number. Defaults to `7`.
*
- * @throws When options define `max < min`.
+ * @throws When `min` is greater than `max`.
+ * @throws When there are no integers between `min` and `max`.
*
* @see faker.string.octal(): For generating an `octal string` with a given length (range).
*
@@ -266,7 +272,8 @@ export class NumberModule extends SimpleModuleBase {
* @param options.min Lower bound for generated number. Defaults to `0`.
* @param options.max Upper bound for generated number. Defaults to `15`.
*
- * @throws When options define `max < min`.
+ * @throws When `min` is greater than `max`.
+ * @throws When there are no integers between `min` and `max`.
*
* @example
* faker.number.hex() // 'b'
@@ -313,7 +320,7 @@ export class NumberModule extends SimpleModuleBase {
* @param options.min Lower bound for generated bigint. Defaults to `0n`.
* @param options.max Upper bound for generated bigint. Defaults to `min + 999999999999999n`.
*
- * @throws When options define `max < min`.
+ * @throws When `min` is greater than `max`.
*
* @example
* faker.number.bigInt() // 55422n