@axi-engine/utils 0.1.8 → 0.1.9

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.
Files changed (56) hide show
  1. package/dist/arrays.d.ts +72 -0
  2. package/dist/arrays.d.ts.map +1 -0
  3. package/dist/arrays.js +115 -0
  4. package/dist/arrays.js.map +1 -0
  5. package/dist/assertion.d.ts +31 -0
  6. package/dist/assertion.d.ts.map +1 -0
  7. package/dist/assertion.js +41 -0
  8. package/dist/assertion.js.map +1 -0
  9. package/dist/config.d.ts +10 -0
  10. package/dist/config.d.ts.map +1 -0
  11. package/dist/config.js +12 -0
  12. package/dist/config.js.map +1 -0
  13. package/dist/constructor-registry.d.ts +40 -0
  14. package/dist/constructor-registry.d.ts.map +1 -0
  15. package/dist/constructor-registry.js +52 -0
  16. package/dist/constructor-registry.js.map +1 -0
  17. package/dist/emitter.d.ts +32 -0
  18. package/dist/emitter.d.ts.map +1 -0
  19. package/dist/emitter.js +43 -0
  20. package/dist/emitter.js.map +1 -0
  21. package/dist/guards.d.ts +12 -0
  22. package/dist/guards.d.ts.map +1 -0
  23. package/dist/guards.js +24 -0
  24. package/dist/guards.js.map +1 -0
  25. package/dist/index.d.mts +72 -84
  26. package/dist/index.d.ts +12 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +12 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/index.mjs +172 -295
  31. package/dist/math.d.ts +17 -0
  32. package/dist/math.d.ts.map +1 -0
  33. package/dist/math.js +26 -0
  34. package/dist/math.js.map +1 -0
  35. package/dist/misc.d.ts +7 -0
  36. package/dist/misc.d.ts.map +1 -0
  37. package/dist/misc.js +9 -0
  38. package/dist/misc.js.map +1 -0
  39. package/dist/path.d.ts +10 -0
  40. package/dist/path.d.ts.map +1 -0
  41. package/dist/path.js +14 -0
  42. package/dist/path.js.map +1 -0
  43. package/dist/random.d.ts +14 -0
  44. package/dist/random.d.ts.map +1 -0
  45. package/dist/random.js +21 -0
  46. package/dist/random.js.map +1 -0
  47. package/dist/types.d.ts +50 -0
  48. package/dist/types.d.ts.map +1 -0
  49. package/dist/types.js +2 -0
  50. package/dist/types.js.map +1 -0
  51. package/package.json +38 -38
  52. package/dist/index.cjs +0 -380
  53. package/dist/index.d.cts +0 -305
  54. package/dist/index.d.cts.map +0 -1
  55. package/dist/index.d.mts.map +0 -1
  56. package/dist/index.mjs.map +0 -1
package/dist/random.js ADDED
@@ -0,0 +1,21 @@
1
+ import { v4 as uuidv4 } from 'uuid';
2
+ /**
3
+ * Returns a random integer between min (inclusive) and max (exclusive).
4
+ * @param min The minimum integer (inclusive).
5
+ * @param max The maximum integer (exclusive).
6
+ * @returns A random integer.
7
+ * @example randInt(1, 5); // returns 1, 2, 3, or 4
8
+ */
9
+ export function randInt(min, max) {
10
+ min = Math.ceil(min);
11
+ max = Math.floor(max);
12
+ return Math.floor(Math.random() * (max - min) + min);
13
+ }
14
+ /**
15
+ * Generates a unique identifier using uuidv4.
16
+ * @returns A unique string ID.
17
+ */
18
+ export function randId() {
19
+ return uuidv4();
20
+ }
21
+ //# sourceMappingURL=random.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random.js","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,GAAW,EAAE,GAAW;IAC9C,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,MAAM,EAAE,CAAC;AAClB,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Represents a path that can be provided as a single string
3
+ * or an array of segments.
4
+ * @example
5
+ * 'player/stats/health'
6
+ * ['player', 'stats', 'health']
7
+ */
8
+ export type PathType = string | string[];
9
+ /**
10
+ * Represents a generic constructor for any class.
11
+ *
12
+ * This utility type is essential for implementing higher-order patterns
13
+ * like mixins, where a function takes a class as an argument and returns
14
+ * a new, extended class.
15
+ *
16
+ * The `...args: any[]` signature allows it to represent constructors
17
+ * with any number and type of arguments, making it universally applicable.
18
+ *
19
+ * @template T - The type of the instance created by the constructor. Defaults to `{}`.
20
+ *
21
+ * @example
22
+ * // Used as a constraint for a base class in a mixin
23
+ * function Timestamped<TBase extends Constructor>(Base: TBase) {
24
+ * return class extends Base {
25
+ * timestamp = new Date();
26
+ * };
27
+ * }
28
+ *
29
+ * class User {}
30
+ * const TimestampedUser = Timestamped(User);
31
+ * const userInstance = new TimestampedUser();
32
+ * console.log(userInstance.timestamp); // Logs the current date
33
+ */
34
+ export type Constructor<T = {}> = new (...args: any[]) => T;
35
+ /**
36
+ * Defines the public, read-only contract for an event emitter.
37
+ * It allows subscribing to an event but not emitting it.
38
+ * @template T A tuple representing the types of the event arguments.
39
+ */
40
+ export type Subscribable<T extends any[]> = {
41
+ readonly listenerCount: number;
42
+ /**
43
+ * Subscribes a listener to this event.
44
+ * @returns A function to unsubscribe the listener.
45
+ */
46
+ subscribe(listener: (...args: T) => void): () => void;
47
+ unsubscribe(listener: (...args: T) => void): boolean;
48
+ clear(): void;
49
+ };
50
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,GAAG,EAAE,IAAI;IAC1C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAEtD,WAAW,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC;IAErD,KAAK,IAAI,IAAI,CAAC;CACf,CAAA"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,38 +1,38 @@
1
- {
2
- "name": "@axi-engine/utils",
3
- "version": "0.1.8",
4
- "description": "Core utility library for Axi Engine, providing common functions for arrays, math, type guards, and more.",
5
- "license": "MIT",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/axijs/engine.git",
9
- "directory": "packages/utils"
10
- },
11
- "keywords": [
12
- "axi-engine",
13
- "typescript",
14
- "gamedev",
15
- "utils"
16
- ],
17
- "types": "./dist/index.d.ts",
18
- "main": "./dist/index.js",
19
- "module": "./dist/index.mjs",
20
- "exports": {
21
- ".": {
22
- "types": "./dist/index.d.ts",
23
- "import": "./dist/index.mjs",
24
- "require": "./dist/index.js"
25
- }
26
- },
27
- "scripts": {
28
- "build": "tsdown src/index.ts --format cjs,esm --dts --clean",
29
- "docs": "typedoc src/index.ts --out docs/api --options ../../typedoc.json",
30
- "test": "echo 'No tests yet for @axi-engine/utils'"
31
- },
32
- "files": [
33
- "dist"
34
- ],
35
- "dependencies": {
36
- "uuid": "^13.0.0"
37
- }
38
- }
1
+ {
2
+ "name": "@axi-engine/utils",
3
+ "version": "0.1.9",
4
+ "description": "Core utility library for Axi Engine, providing common functions for arrays, math, type guards, and more.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/axijs/engine.git",
9
+ "directory": "packages/utils"
10
+ },
11
+ "keywords": [
12
+ "axi-engine",
13
+ "typescript",
14
+ "gamedev",
15
+ "utils"
16
+ ],
17
+ "types": "./dist/index.d.ts",
18
+ "main": "./dist/index.js",
19
+ "module": "./dist/index.mjs",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.mjs",
24
+ "require": "./dist/index.js"
25
+ }
26
+ },
27
+ "scripts": {
28
+ "build": "tsup",
29
+ "docs": "typedoc src/index.ts --out docs/api --options ../../typedoc.json",
30
+ "test": "echo 'No tests yet for @axi-engine/utils'"
31
+ },
32
+ "files": [
33
+ "dist"
34
+ ],
35
+ "dependencies": {
36
+ "uuid": "^13.0.0"
37
+ }
38
+ }
package/dist/index.cjs DELETED
@@ -1,380 +0,0 @@
1
- let uuid = require("uuid");
2
-
3
- //#region src/arrays.ts
4
- /**
5
- * Generates an array of numbers from 0 to length-1.
6
- * @param length The desired length of the array.
7
- * @returns An array of sequential numbers.
8
- * @example genArray(3); // returns [0, 1, 2]
9
- */
10
- function genArray(length) {
11
- return Array.from({ length }, (_v, i) => i);
12
- }
13
- /**
14
- * Creates a new array with its elements shuffled in a random order.
15
- * This function does not mutate the original array.
16
- * @template T The type of elements in the array.
17
- * @param array The array to shuffle.
18
- * @returns A new, shuffled array.
19
- */
20
- function shuffleArray(array) {
21
- const result = [...array];
22
- for (let i = result.length - 1; i > 0; i--) {
23
- const j = Math.floor(Math.random() * (i + 1));
24
- [result[i], result[j]] = [result[j], result[i]];
25
- }
26
- return result;
27
- }
28
- /**
29
- * Checks if the first array is a sequential starting subset of the second array.
30
- * @param arr1 The potential subset array.
31
- * @param arr2 The array to check against.
32
- * @returns `true` if arr1 is a sequential start of arr2, otherwise `false`.
33
- * @example
34
- * isSequentialStart([1, 2], [1, 2, 3]); // true
35
- * isSequentialStart([1, 3], [1, 2, 3]); // false
36
- */
37
- function isSequentialStart(arr1, arr2) {
38
- if (arr1.length > arr2.length) return false;
39
- return arr1.every((element, index) => element === arr2[index]);
40
- }
41
- /**
42
- * Checks if two arrays contain the same elements, ignoring order.
43
- * Works for arrays of primitives like strings or numbers.
44
- * @template T The type of elements in the array.
45
- * @param arr1 The first array.
46
- * @param arr2 The second array.
47
- * @returns `true` if both arrays contain the same elements, otherwise `false`.
48
- * @example
49
- * haveSameElements(['a', 'b'], ['b', 'a']); // true
50
- * haveSameElements([1, 2, 3], [3, 1, 2]); // true
51
- * haveSameElements(['a', 'b'], ['a', 'c']); // false
52
- */
53
- function haveSameElements(arr1, arr2) {
54
- if (!arr1 && !arr2) return true;
55
- if (!arr1 || !arr2) return false;
56
- if (arr1.length !== arr2.length) return false;
57
- const sortedArr1 = [...arr1].sort();
58
- const sortedArr2 = [...arr2].sort();
59
- return sortedArr1.every((value, index) => value === sortedArr2[index]);
60
- }
61
- /**
62
- * Checks if two arrays are strictly equal (same elements in the same order).
63
- * @template T The type of elements in the array.
64
- * @param arr1 The first array.
65
- * @param arr2 The second array.
66
- * @returns `true` if the arrays are strictly equal, otherwise `false`.
67
- * @example
68
- * areArraysEqual(['a', 'b'], ['a', 'b']); // true
69
- * areArraysEqual(['a', 'b'], ['b', 'a']); // false
70
- * areArraysEqual([1, 2], [1, 2, 3]); // false
71
- */
72
- function areArraysEqual(arr1, arr2) {
73
- if (!arr1 && !arr2) return true;
74
- if (!arr1 || !arr2) return false;
75
- if (arr1.length !== arr2.length) return false;
76
- return arr1.every((value, index) => value === arr2[index]);
77
- }
78
- /**
79
- * Gets the last element of an array.
80
- * @template T The type of elements in the array.
81
- * @param array The array to query.
82
- * @returns The last element of the array, or `undefined` if the array is empty.
83
- */
84
- function last(array) {
85
- return array[array.length - 1];
86
- }
87
- /**
88
- * Creates a duplicate-free version of an array.
89
- * @template T The type of elements in the array.
90
- * @param array The array to process.
91
- * @returns A new array with only unique elements.
92
- */
93
- function unique(array) {
94
- return [...new Set(array)];
95
- }
96
- /**
97
- * Gets a random element from an array.
98
- * @template T The type of elements in the array.
99
- * @param array The array to choose from.
100
- * @returns A random element from the array, or `undefined` if the array is empty.
101
- */
102
- function getRandomElement(array) {
103
- if (array.length === 0) return;
104
- return array[Math.floor(Math.random() * array.length)];
105
- }
106
-
107
- //#endregion
108
- //#region src/guards.ts
109
- function isNullOrUndefined(val) {
110
- return val === void 0 || val === null;
111
- }
112
- function isUndefined(val) {
113
- return typeof val === "undefined";
114
- }
115
- function isNumber(val) {
116
- return typeof val === "number";
117
- }
118
- function isBoolean(val) {
119
- return typeof val === "boolean";
120
- }
121
- function isString(val) {
122
- return typeof val === "string";
123
- }
124
- /**
125
- * Type guard to check if a value is a string that ends with '%'.
126
- * @param val The value to check.
127
- * @returns `true` if the value is a percentage string.
128
- */
129
- function isPercentageString(val) {
130
- return typeof val === "string" && val.endsWith("%");
131
- }
132
-
133
- //#endregion
134
- //#region src/assertion.ts
135
- /**
136
- * Throws an error if the condition is true.
137
- * @param conditionForThrow - If true, an error will be thrown.
138
- * @param exceptionMessage - The message for the error.
139
- * @throws {Error} if the value is true
140
- */
141
- function throwIf(conditionForThrow, exceptionMessage) {
142
- if (conditionForThrow) throw new Error(exceptionMessage);
143
- }
144
- /**
145
- * Throws an error if the value is null, undefined, or an empty array.
146
- *
147
- * @template T The type of the value being checked.
148
- * @param value The value to check.
149
- * @param exceptionMessage The message for the error.
150
- * @throws {Error} if the value is null, undefined, or an empty array.
151
- *
152
- * @example
153
- * // Example with a potentially undefined variable
154
- * const user: { name: string } | undefined = findUser();
155
- * throwIfEmpty(user, 'User not found');
156
- * // From here, TypeScript knows `user` is not undefined.
157
- * console.log(user.name);
158
- *
159
- * @example
160
- * // Example with an array
161
- * const items: string[] = getItems();
162
- * throwIfEmpty(items, 'Items array cannot be empty');
163
- * // From here, you can safely access items[0] without checking for an empty array again.
164
- * console.log('First item:', items[0]);
165
- */
166
- function throwIfEmpty(value, exceptionMessage) {
167
- const isArrayAndEmpty = Array.isArray(value) && value.length === 0;
168
- if (isNullOrUndefined(value) || isArrayAndEmpty) throw new Error(exceptionMessage);
169
- }
170
-
171
- //#endregion
172
- //#region src/config.ts
173
- const defaultConfig = { pathSeparator: "/" };
174
- const axiSettings = { ...defaultConfig };
175
- /**
176
- * set up global configuration for axi-engine.
177
- * @param newConfig - configuration object
178
- */
179
- function configure(newConfig) {
180
- Object.assign(axiSettings, newConfig);
181
- }
182
-
183
- //#endregion
184
- //#region src/constructor-registry.ts
185
- /**
186
- * A generic registry for mapping string identifiers to class constructors.
187
- *
188
- * This utility is fundamental for building extensible systems like dependency injection containers,
189
- * factories, and serialization engines where types need to be dynamically resolved.
190
- *
191
- * @template T - A base type that all registered constructors must produce an instance of.
192
- */
193
- var ConstructorRegistry = class {
194
- items = /* @__PURE__ */ new Map();
195
- /**
196
- * Registers a constructor with a unique string identifier.
197
- *
198
- * @param typeId - The unique identifier for the constructor (e.g., a static `typeName` property from a class).
199
- * @param ctor - The class constructor to register.
200
- * @returns The registry instance for chainable calls.
201
- * @throws If a constructor with the same `typeId` is already registered.
202
- */
203
- register(typeId, ctor) {
204
- throwIf(this.items.has(typeId), `A constructor with typeId '${typeId}' is already registered.`);
205
- this.items.set(typeId, ctor);
206
- return this;
207
- }
208
- /**
209
- * Retrieves a constructor by its identifier.
210
- *
211
- * @param typeId - The identifier of the constructor to retrieve.
212
- * @returns The found class constructor.
213
- * @throws If no constructor is found for the given `typeId`.
214
- */
215
- get(typeId) {
216
- const Ctor = this.items.get(typeId);
217
- throwIfEmpty(Ctor, `No constructor found for typeId '${typeId}'`);
218
- return Ctor;
219
- }
220
- /**
221
- * Checks if a constructor for a given identifier is registered.
222
- * @param typeId - The identifier to check.
223
- * @returns `true` if a constructor is registered, otherwise `false`.
224
- */
225
- has(typeId) {
226
- return this.items.has(typeId);
227
- }
228
- /**
229
- * Clears all registered constructors from the registry.
230
- */
231
- clear() {
232
- this.items.clear();
233
- }
234
- };
235
-
236
- //#endregion
237
- //#region src/emitter.ts
238
- /**
239
- * A minimal, type-safe event emitter for a single event.
240
- * It does not manage state, it only manages subscribers and event dispatching.
241
- * @template T A tuple representing the types of the event arguments.
242
- */
243
- var Emitter = class {
244
- listeners = /* @__PURE__ */ new Set();
245
- /**
246
- * Returns the number of listeners.
247
- */
248
- get listenerCount() {
249
- return this.listeners.size;
250
- }
251
- /**
252
- * Subscribes a listener to this event.
253
- * @returns A function to unsubscribe the listener.
254
- */
255
- subscribe(listener) {
256
- this.listeners.add(listener);
257
- return () => this.listeners.delete(listener);
258
- }
259
- /**
260
- * Manually unsubscribe by listener
261
- * @returns returns true if an listener has been removed, or false if the listener does not exist.
262
- */
263
- unsubscribe(listener) {
264
- return this.listeners.delete(listener);
265
- }
266
- /**
267
- * Dispatches the event to all subscribed listeners.
268
- */
269
- emit(...args) {
270
- this.listeners.forEach((listener) => listener(...args));
271
- }
272
- /**
273
- * Clears all listeners.
274
- */
275
- clear() {
276
- this.listeners.clear();
277
- }
278
- };
279
-
280
- //#endregion
281
- //#region src/math.ts
282
- /**
283
- * Clamps a number between an optional minimum and maximum value.
284
- * @param val The number to clamp.
285
- * @param min The minimum value. If null or undefined, it's ignored.
286
- * @param max The maximum value. If null or undefined, it's ignored.
287
- * @returns The clamped number.
288
- */
289
- function clampNumber(val, min, max) {
290
- if (!isNullOrUndefined(min)) val = Math.max(val, min);
291
- if (!isNullOrUndefined(max)) val = Math.min(val, max);
292
- return val;
293
- }
294
- /**
295
- * Calculates a percentage of a given value.
296
- * @param val The base value.
297
- * @param percents The percentage to get.
298
- * @returns The calculated percentage of the value.
299
- * @example getPercentOf(200, 10); // returns 20
300
- */
301
- function getPercentOf(val, percents) {
302
- return percents / 100 * val;
303
- }
304
-
305
- //#endregion
306
- //#region src/misc.ts
307
- /**
308
- * Returns the first key of an object.
309
- * @param obj The object from which to get the key.
310
- * @returns The first key of the object as a string.
311
- */
312
- function firstKeyOf(obj) {
313
- return Object.keys(obj)[0];
314
- }
315
-
316
- //#endregion
317
- //#region src/path.ts
318
- /**
319
- * Ensures that the given path is returned as an array of segments.
320
- */
321
- function ensurePathArray(path, separator = axiSettings.pathSeparator) {
322
- return Array.isArray(path) ? [...path] : path.split(separator);
323
- }
324
- /**
325
- * Ensures that the given path is returned as a single string.
326
- */
327
- function ensurePathString(path, separator = axiSettings.pathSeparator) {
328
- return !Array.isArray(path) ? path : path.join(separator);
329
- }
330
-
331
- //#endregion
332
- //#region src/random.ts
333
- /**
334
- * Returns a random integer between min (inclusive) and max (exclusive).
335
- * @param min The minimum integer (inclusive).
336
- * @param max The maximum integer (exclusive).
337
- * @returns A random integer.
338
- * @example randInt(1, 5); // returns 1, 2, 3, or 4
339
- */
340
- function randInt(min, max) {
341
- min = Math.ceil(min);
342
- max = Math.floor(max);
343
- return Math.floor(Math.random() * (max - min) + min);
344
- }
345
- /**
346
- * Generates a unique identifier using uuidv4.
347
- * @returns A unique string ID.
348
- */
349
- function randId() {
350
- return (0, uuid.v4)();
351
- }
352
-
353
- //#endregion
354
- exports.ConstructorRegistry = ConstructorRegistry;
355
- exports.Emitter = Emitter;
356
- exports.areArraysEqual = areArraysEqual;
357
- exports.axiSettings = axiSettings;
358
- exports.clampNumber = clampNumber;
359
- exports.configure = configure;
360
- exports.ensurePathArray = ensurePathArray;
361
- exports.ensurePathString = ensurePathString;
362
- exports.firstKeyOf = firstKeyOf;
363
- exports.genArray = genArray;
364
- exports.getPercentOf = getPercentOf;
365
- exports.getRandomElement = getRandomElement;
366
- exports.haveSameElements = haveSameElements;
367
- exports.isBoolean = isBoolean;
368
- exports.isNullOrUndefined = isNullOrUndefined;
369
- exports.isNumber = isNumber;
370
- exports.isPercentageString = isPercentageString;
371
- exports.isSequentialStart = isSequentialStart;
372
- exports.isString = isString;
373
- exports.isUndefined = isUndefined;
374
- exports.last = last;
375
- exports.randId = randId;
376
- exports.randInt = randInt;
377
- exports.shuffleArray = shuffleArray;
378
- exports.throwIf = throwIf;
379
- exports.throwIfEmpty = throwIfEmpty;
380
- exports.unique = unique;