jssm 5.65.4 → 5.65.5
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/dist/es6/jssm_util.d.ts +43 -1
- package/dist/es6/jssm_util.js +53 -2
- package/dist/es6/version.js +1 -1
- package/dist/jssm.es5.cjs.js +1 -1
- package/dist/jssm.es5.iife.js +1 -1
- package/jssm_util.d.ts +43 -1
- package/package.json +1 -1
package/jssm_util.d.ts
CHANGED
|
@@ -1,10 +1,52 @@
|
|
|
1
|
+
/*******
|
|
2
|
+
*
|
|
3
|
+
* Predicate for validating an array for uniqueness. Not generally meant for
|
|
4
|
+
* external use.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
1
7
|
declare function arr_uniq_p<T>(el: T, i: number, source: T[]): boolean;
|
|
2
8
|
declare const array_box_if_string: (n: any) => any;
|
|
3
9
|
declare const weighted_rand_select: Function;
|
|
4
|
-
|
|
10
|
+
/*******
|
|
11
|
+
*
|
|
12
|
+
* Returns, for a non-negative integer argument `n`, the series `[0 .. n]`.
|
|
13
|
+
*
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { seq } from './jssm';
|
|
16
|
+
*
|
|
17
|
+
* seq(5); // [0, 1, 2, 3, 4]
|
|
18
|
+
* seq(0); // []
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
declare function seq(n: number): number[];
|
|
23
|
+
/*******
|
|
24
|
+
*
|
|
25
|
+
* Returns the histograph of an array as a `Map`. Makes no attempt to cope
|
|
26
|
+
* with deep equality; will fail for complex contents, as such.
|
|
27
|
+
*
|
|
28
|
+
* ```typescript
|
|
29
|
+
* import { histograph } from './jssm';
|
|
30
|
+
*
|
|
31
|
+
* histograph( [0, 0, 1, 1, 2, 2, 1] ); // Map()
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
5
35
|
declare const histograph: Function;
|
|
6
36
|
declare const weighted_sample_select: Function;
|
|
7
37
|
declare const weighted_histo_key: Function;
|
|
38
|
+
/*******
|
|
39
|
+
*
|
|
40
|
+
* Internal method generating names for edges for the hook lookup map. Not
|
|
41
|
+
* meant for external use.
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
8
44
|
declare const hook_name: (from: string, to: string) => string;
|
|
45
|
+
/*******
|
|
46
|
+
*
|
|
47
|
+
* Internal method generating names for actions for the hook lookup map. Not
|
|
48
|
+
* meant for external use.
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
9
51
|
declare const named_hook_name: (from: string, to: string, action: string) => string;
|
|
10
52
|
export { seq, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, hook_name, named_hook_name };
|