@thi.ng/random 3.3.0 → 3.3.1
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 +1 -1
- package/package.json +10 -10
- package/unique-indices.d.ts +1 -1
- package/uuid.d.ts +2 -2
- package/weighted-random.d.ts +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/random",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"description": "Pseudo-random number generators w/ unified API, distributions, weighted choices, ID generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.3.
|
|
38
|
-
"@thi.ng/checks": "^3.
|
|
39
|
-
"@thi.ng/errors": "^2.1.
|
|
40
|
-
"@thi.ng/hex": "^2.1.
|
|
37
|
+
"@thi.ng/api": "^8.3.7",
|
|
38
|
+
"@thi.ng/checks": "^3.2.0",
|
|
39
|
+
"@thi.ng/errors": "^2.1.7",
|
|
40
|
+
"@thi.ng/hex": "^2.1.7"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@microsoft/api-extractor": "^7.
|
|
44
|
-
"@thi.ng/testament": "^0.2.
|
|
43
|
+
"@microsoft/api-extractor": "^7.25.0",
|
|
44
|
+
"@thi.ng/testament": "^0.2.8",
|
|
45
45
|
"rimraf": "^3.0.2",
|
|
46
46
|
"tools": "^0.0.1",
|
|
47
|
-
"typedoc": "^0.22.
|
|
48
|
-
"typescript": "^4.
|
|
47
|
+
"typedoc": "^0.22.17",
|
|
48
|
+
"typescript": "^4.7.3"
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
51
51
|
"binary",
|
|
@@ -156,5 +156,5 @@
|
|
|
156
156
|
"ksuid"
|
|
157
157
|
]
|
|
158
158
|
},
|
|
159
|
-
"gitHead": "
|
|
159
|
+
"gitHead": "9e516d30a1a537e027a6b3d78bf9121bc5831d31\n"
|
|
160
160
|
}
|
package/unique-indices.d.ts
CHANGED
|
@@ -28,5 +28,5 @@ export declare const uniqueValuesFrom: (k: number, fn: Fn0<number>, existing?: n
|
|
|
28
28
|
* @param maxTrials -
|
|
29
29
|
* @param rnd -
|
|
30
30
|
*/
|
|
31
|
-
export declare const uniqueIndices: (k: number, max: number, existing?: number[]
|
|
31
|
+
export declare const uniqueIndices: (k: number, max: number, existing?: number[], maxTrials?: number, rnd?: IRandom) => number[];
|
|
32
32
|
//# sourceMappingURL=unique-indices.d.ts.map
|
package/uuid.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { IRandom } from "./api.js";
|
|
|
7
7
|
* @param buf -
|
|
8
8
|
* @param rnd -
|
|
9
9
|
*/
|
|
10
|
-
export declare const uuidv4Bytes: (buf?: Uint8Array
|
|
10
|
+
export declare const uuidv4Bytes: (buf?: Uint8Array, rnd?: IRandom) => Uint8Array;
|
|
11
11
|
/**
|
|
12
12
|
* Returns a UUID string, either from given byte array, or if omitted, using a
|
|
13
13
|
* new UUID v4 produced by {@link uuidv4Bytes}.
|
|
@@ -15,5 +15,5 @@ export declare const uuidv4Bytes: (buf?: Uint8Array | undefined, rnd?: IRandom |
|
|
|
15
15
|
* @param id - byte array
|
|
16
16
|
* @param i - start index
|
|
17
17
|
*/
|
|
18
|
-
export declare const uuid: (id?: ArrayLike<number
|
|
18
|
+
export declare const uuid: (id?: ArrayLike<number>, i?: number) => string;
|
|
19
19
|
//# sourceMappingURL=uuid.d.ts.map
|
package/weighted-random.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type { IRandom } from "./api.js";
|
|
|
18
18
|
* @param choices -
|
|
19
19
|
* @param weights - optional weights
|
|
20
20
|
*/
|
|
21
|
-
export declare const weightedRandom: <T>(choices: T[], weights?: ArrayLike<number
|
|
21
|
+
export declare const weightedRandom: <T>(choices: T[], weights?: ArrayLike<number>, rnd?: IRandom) => () => T;
|
|
22
22
|
/**
|
|
23
23
|
* Alt version of {@link weightedRandom}, accepting an object of weights
|
|
24
24
|
* instead. The returned function will return keys of given `choices` object,
|