bias-random 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.cts +12 -8
- package/dist/index.d.ts +12 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -5,15 +5,19 @@ interface BiasedRandomOptions {
|
|
|
5
5
|
max?: number;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* Generates a random number
|
|
8
|
+
* Generates a random number between `min` and `max`, with an optional bias towards the lower or upper bound.
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
11
|
-
*
|
|
12
|
-
* @param biasLevel
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
10
|
+
* @param {Object} [options] - Optional configuration object to adjust the behavior of the random number generation.
|
|
11
|
+
* @param {boolean} [options.upperBias=false] - If true, biases the result towards the higher bound (`max`), otherwise biases towards the lower bound (`min`). Default is `false`.
|
|
12
|
+
* @param {number} [options.biasLevel=2] - Determines the strength of the bias. Must be 1 or greater, where `1` means no bias and higher values increase the bias. Default is `2`.
|
|
13
|
+
* @param {number} [options.min=0] - The minimum value for the random number range. Default is `0`.
|
|
14
|
+
* @param {number} [options.max=1] - The maximum value for the random number range. Default is `1`.
|
|
15
|
+
*
|
|
16
|
+
* @returns {number} A random number between `min` and `max`, optionally biased based on the provided options.
|
|
17
|
+
*
|
|
18
|
+
* @throws {TypeError} If `biasLevel` is not a number or is less than 1.
|
|
19
|
+
* @throws {TypeError} If `min` is not less than `max`, or if either `min` or `max` is not a number.
|
|
20
|
+
* @throws {TypeError} If `upperBias` is not a boolean.
|
|
17
21
|
*/
|
|
18
22
|
declare const biasedRandom: ({ upperBias, biasLevel, min, max }?: BiasedRandomOptions) => number;
|
|
19
23
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5,15 +5,19 @@ interface BiasedRandomOptions {
|
|
|
5
5
|
max?: number;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* Generates a random number
|
|
8
|
+
* Generates a random number between `min` and `max`, with an optional bias towards the lower or upper bound.
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
11
|
-
*
|
|
12
|
-
* @param biasLevel
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
10
|
+
* @param {Object} [options] - Optional configuration object to adjust the behavior of the random number generation.
|
|
11
|
+
* @param {boolean} [options.upperBias=false] - If true, biases the result towards the higher bound (`max`), otherwise biases towards the lower bound (`min`). Default is `false`.
|
|
12
|
+
* @param {number} [options.biasLevel=2] - Determines the strength of the bias. Must be 1 or greater, where `1` means no bias and higher values increase the bias. Default is `2`.
|
|
13
|
+
* @param {number} [options.min=0] - The minimum value for the random number range. Default is `0`.
|
|
14
|
+
* @param {number} [options.max=1] - The maximum value for the random number range. Default is `1`.
|
|
15
|
+
*
|
|
16
|
+
* @returns {number} A random number between `min` and `max`, optionally biased based on the provided options.
|
|
17
|
+
*
|
|
18
|
+
* @throws {TypeError} If `biasLevel` is not a number or is less than 1.
|
|
19
|
+
* @throws {TypeError} If `min` is not less than `max`, or if either `min` or `max` is not a number.
|
|
20
|
+
* @throws {TypeError} If `upperBias` is not a boolean.
|
|
17
21
|
*/
|
|
18
22
|
declare const biasedRandom: ({ upperBias, biasLevel, min, max }?: BiasedRandomOptions) => number;
|
|
19
23
|
|
package/package.json
CHANGED