@inrixia/helpers 3.13.6 → 3.14.0
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/fn/Promize.js +4 -4
- package/dist/fn/Promize.js.map +1 -1
- package/dist/fn/memoize.d.ts +53 -3
- package/dist/fn/memoize.d.ts.map +1 -1
- package/dist/fn/memoize.js +68 -9
- package/dist/fn/memoize.js.map +1 -1
- package/dist/obj/ArgsMap.d.ts +38 -0
- package/dist/obj/ArgsMap.d.ts.map +1 -0
- package/dist/obj/ArgsMap.js +115 -0
- package/dist/obj/ArgsMap.js.map +1 -0
- package/dist/obj/DequalMap.d.ts +20 -0
- package/dist/obj/DequalMap.d.ts.map +1 -0
- package/dist/obj/DequalMap.js +62 -0
- package/dist/obj/DequalMap.js.map +1 -0
- package/dist/obj/StringifyMap.d.ts +35 -0
- package/dist/obj/StringifyMap.d.ts.map +1 -0
- package/dist/obj/StringifyMap.js +51 -0
- package/dist/obj/StringifyMap.js.map +1 -0
- package/dist/ts/types.d.ts +6 -2
- package/dist/ts/types.d.ts.map +1 -1
- package/package.json +4 -1
package/dist/fn/Promize.js
CHANGED
|
@@ -21,10 +21,10 @@ export class Promize {
|
|
|
21
21
|
* Recreate the underlying promise
|
|
22
22
|
*/
|
|
23
23
|
reset() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const withRes = Promise.withResolvers();
|
|
25
|
+
this._promise = withRes.promise;
|
|
26
|
+
this.res = withRes.resolve;
|
|
27
|
+
this.rej = withRes.reject;
|
|
28
28
|
}
|
|
29
29
|
then = (onRes, onRej) => this._promise.then(onRes, onRej);
|
|
30
30
|
catch = (onRej) => this._promise.catch(onRej);
|
package/dist/fn/Promize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Promize.js","sourceRoot":"","sources":["../../src/fn/Promize.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,OAAO;IAC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,CAAC,CAAC;IACnE,OAAO,GAA0B,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7E,qCAAqC;IACrC,CAAC,MAAM,CAAC,WAAW,CAAC,GAAW,SAAS,CAAC;CACzC"}
|
package/dist/fn/memoize.d.ts
CHANGED
|
@@ -1,4 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { AnyFn, VoidLike } from "../ts/types.js";
|
|
2
|
+
export type Memoized<G extends AnyFn> = G & {
|
|
3
|
+
clear: (...args: Parameters<G>) => VoidLike;
|
|
4
|
+
};
|
|
5
|
+
export interface MemoMap<K extends any[] = any[], V extends any = any> {
|
|
6
|
+
get: (key: K) => V | undefined;
|
|
7
|
+
set: (key: K, value: V) => V;
|
|
8
|
+
delete: (key: K) => boolean;
|
|
9
|
+
clear: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare class Memo {
|
|
12
|
+
/**
|
|
13
|
+
* Memoizes a function with a custom cache implementation.
|
|
14
|
+
*
|
|
15
|
+
* @param {G} generator - The function to memoize.
|
|
16
|
+
* @param {C} cache - The cache implementation to use (must extend or implement MemoMap).
|
|
17
|
+
* @returns {O} The memoized function with a `clear` method.
|
|
18
|
+
*/
|
|
19
|
+
static withCache<G extends AnyFn, O extends Memoized<G>, C extends MemoMap>(generator: G, cache: C): O;
|
|
20
|
+
/**
|
|
21
|
+
* Memoizes a function ignoring its arguments.
|
|
22
|
+
*
|
|
23
|
+
* @param {G} generator - The function to memoize.
|
|
24
|
+
* @returns {O} The memoized function with a `clear` method.
|
|
25
|
+
*/
|
|
26
|
+
static argless<G extends AnyFn, O extends Memoized<G>>(generator: G): O;
|
|
27
|
+
/**
|
|
28
|
+
* Memoizes a function using a ArgsMap for caching.
|
|
29
|
+
*
|
|
30
|
+
* @param {G} generator - The function to memoize.
|
|
31
|
+
* @returns {O} The memoized function with a `clear` method.
|
|
32
|
+
*/
|
|
33
|
+
static memo<G extends AnyFn, O extends Memoized<G>>(generator: G): O;
|
|
34
|
+
/**
|
|
35
|
+
* Memoizes a function using deep equality checks for arguments via DequalMap.
|
|
36
|
+
* Note: Performance depends on the number of cached entries, as DequalMap involves iteration for deep checks.
|
|
37
|
+
*
|
|
38
|
+
* @param {G} generator - The function to memoize.
|
|
39
|
+
* @returns {O} The memoized function with a `clear` method.
|
|
40
|
+
*/
|
|
41
|
+
static dequal<G extends AnyFn, O extends Memoized<G>>(generator: G): O;
|
|
42
|
+
/**
|
|
43
|
+
* Memoizes a function using simple caching based on argument presence or JSON stringification.
|
|
44
|
+
*
|
|
45
|
+
* @param {G} generator - The function to memoize.
|
|
46
|
+
* @returns {O} The memoized function with a `clear` method.
|
|
47
|
+
*/
|
|
48
|
+
static stringify<G extends AnyFn, O extends Memoized<G>>(generator: G): O;
|
|
49
|
+
}
|
|
50
|
+
export declare const memoize: typeof Memo.memo;
|
|
51
|
+
export declare const memoizeArgless: typeof Memo.argless;
|
|
52
|
+
export declare const memoizeDequal: typeof Memo.dequal;
|
|
53
|
+
export declare const memoizeStringify: typeof Memo.stringify;
|
|
4
54
|
//# sourceMappingURL=memoize.d.ts.map
|
package/dist/fn/memoize.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoize.d.ts","sourceRoot":"","sources":["../../src/fn/memoize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"memoize.d.ts","sourceRoot":"","sources":["../../src/fn/memoize.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,GAAG;IAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAA;CAAE,CAAC;AAG5F,MAAM,WAAW,OAAO,CAAC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}
|
package/dist/fn/memoize.js
CHANGED
|
@@ -1,15 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ArgsMap } from "../obj/ArgsMap.js";
|
|
2
|
+
import { DequalMap } from "../obj/DequalMap.js"; // Import DequalMap
|
|
3
|
+
import { StringifyMap } from "../obj/StringifyMap.js";
|
|
4
|
+
const setReturnValue = (map, args, value) => {
|
|
5
|
+
map.set(args, value);
|
|
6
|
+
return value;
|
|
7
|
+
};
|
|
8
|
+
export class Memo {
|
|
9
|
+
/**
|
|
10
|
+
* Memoizes a function with a custom cache implementation.
|
|
11
|
+
*
|
|
12
|
+
* @param {G} generator - The function to memoize.
|
|
13
|
+
* @param {C} cache - The cache implementation to use (must extend or implement MemoMap).
|
|
14
|
+
* @returns {O} The memoized function with a `clear` method.
|
|
15
|
+
*/
|
|
16
|
+
static withCache(generator, cache) {
|
|
17
|
+
// Handle cases where arguments are ignored or the function takes no arguments
|
|
18
|
+
if (generator.length === 0)
|
|
19
|
+
return Memo.argless(generator);
|
|
20
|
+
const _fn = ((...args) => cache.get(args) ?? setReturnValue(cache, args, generator(...args)));
|
|
21
|
+
// Add a method to clear a specific cache entry based on arguments or all if nothing passed
|
|
22
|
+
_fn.clear = (...args) => {
|
|
23
|
+
if (args.length === 0)
|
|
24
|
+
cache.clear();
|
|
25
|
+
cache.delete(args);
|
|
26
|
+
};
|
|
27
|
+
return _fn;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Memoizes a function ignoring its arguments.
|
|
31
|
+
*
|
|
32
|
+
* @param {G} generator - The function to memoize.
|
|
33
|
+
* @returns {O} The memoized function with a `clear` method.
|
|
34
|
+
*/
|
|
35
|
+
static argless(generator) {
|
|
3
36
|
let cache;
|
|
4
37
|
const _fn = (() => (cache ??= generator()));
|
|
5
38
|
_fn.clear = () => (cache = undefined);
|
|
6
39
|
return _fn;
|
|
7
40
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Memoizes a function using a ArgsMap for caching.
|
|
43
|
+
*
|
|
44
|
+
* @param {G} generator - The function to memoize.
|
|
45
|
+
* @returns {O} The memoized function with a `clear` method.
|
|
46
|
+
*/
|
|
47
|
+
static memo(generator) {
|
|
48
|
+
return Memo.withCache(generator, new ArgsMap());
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Memoizes a function using deep equality checks for arguments via DequalMap.
|
|
52
|
+
* Note: Performance depends on the number of cached entries, as DequalMap involves iteration for deep checks.
|
|
53
|
+
*
|
|
54
|
+
* @param {G} generator - The function to memoize.
|
|
55
|
+
* @returns {O} The memoized function with a `clear` method.
|
|
56
|
+
*/
|
|
57
|
+
static dequal(generator) {
|
|
58
|
+
return Memo.withCache(generator, new DequalMap());
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Memoizes a function using simple caching based on argument presence or JSON stringification.
|
|
62
|
+
*
|
|
63
|
+
* @param {G} generator - The function to memoize.
|
|
64
|
+
* @returns {O} The memoized function with a `clear` method.
|
|
65
|
+
*/
|
|
66
|
+
static stringify(generator) {
|
|
67
|
+
return Memo.withCache(generator, new StringifyMap());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export const memoize = Memo.memo;
|
|
71
|
+
export const memoizeArgless = Memo.argless;
|
|
72
|
+
export const memoizeDequal = Memo.dequal;
|
|
73
|
+
export const memoizeStringify = Memo.stringify;
|
|
15
74
|
//# sourceMappingURL=memoize.js.map
|
package/dist/fn/memoize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoize.js","sourceRoot":"","sources":["../../src/fn/memoize.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"memoize.js","sourceRoot":"","sources":["../../src/fn/memoize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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C,CAAC;QACtC,OAAO,GAAG,CAAC;IACZ,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,IAAI,CAAyC,SAAY;QACtE,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,OAAO,EAAE,CAAM,CAAC;IACtD,CAAC;IACD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAyC,SAAY;QACxE,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,SAAS,EAAE,CAAM,CAAC;IACxD,CAAC;IACD;;;;;OAKG;IACI,MAAM,CAAC,SAAS,CAAyC,SAAY;QAC3E,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,YAAY,EAAE,CAAM,CAAC;IAC3D,CAAC;CACD;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;AACjC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC;AAC3C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Map implementation using an array of arguments (`any[]`) as its key.
|
|
3
|
+
* Uses a nested Map structure, allowing keys with any JavaScript value.
|
|
4
|
+
* Performance is typically proportional to the number of arguments in the key.
|
|
5
|
+
*
|
|
6
|
+
* @template K - The type of the key (array of any).
|
|
7
|
+
* @template V - The type of the value.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ArgsMap<K extends any[], V> {
|
|
10
|
+
private readonly root;
|
|
11
|
+
private _size;
|
|
12
|
+
private static readonly END_MARKER;
|
|
13
|
+
/** Returns the number of key/value pairs in the ArgsMap object. */
|
|
14
|
+
get size(): number;
|
|
15
|
+
/** Sets the value for the key in the ArgsMap object. Returns the value. */
|
|
16
|
+
setReturnValue(key: K, value: V): V;
|
|
17
|
+
/** Sets the value for the key in the ArgsMap object. Returns the ArgsMap object. */
|
|
18
|
+
set(key: K, value: V): this;
|
|
19
|
+
/** Returns the value associated with the key, or undefined if there is none. */
|
|
20
|
+
get(key: K): V | undefined;
|
|
21
|
+
/** Returns a boolean indicating whether an element with the specified key exists or not. */
|
|
22
|
+
has(key: K): boolean;
|
|
23
|
+
/** Returns true if an element in the ArgsMap object existed and has been removed, or false if the element does not exist. */
|
|
24
|
+
delete(key: K): boolean;
|
|
25
|
+
/** Recursive helper for delete, cleaning up empty parent maps. */
|
|
26
|
+
private _deleteRecursive;
|
|
27
|
+
/** Removes all key/value pairs from the ArgsMap object. */
|
|
28
|
+
clear(): void;
|
|
29
|
+
/** Returns a new Iterator object that contains the [key, value] pairs for each element in the ArgsMap object in insertion order. */
|
|
30
|
+
entries(): IterableIterator<[K, V]>;
|
|
31
|
+
/** Recursive helper for depth-first entry iteration. */
|
|
32
|
+
private _traverseEntries;
|
|
33
|
+
/** Returns a new Iterator object that contains the [key, value] pairs for each element in the ArgsMap object in insertion order. */
|
|
34
|
+
[Symbol.iterator](): IterableIterator<[K, V]>;
|
|
35
|
+
/** Returns a string representing the object. */
|
|
36
|
+
get [Symbol.toStringTag](): string;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=ArgsMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArgsMap.d.ts","sourceRoot":"","sources":["../../src/obj/ArgsMap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,OAAO,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,CAAC;IAEtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA4B;IACjD,OAAO,CAAC,KAAK,CAAa;IAE1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAwC;IAE1E,mEAAmE;IACnE,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,2EAA2E;IACpE,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;IAK1C,oFAAoF;IAC7E,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAelC,gFAAgF;IACzE,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAUjC,4FAA4F;IACrF,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAU3B,6HAA6H;IACtH,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAM9B,kEAAkE;IAClE,OAAO,CAAC,gBAAgB;IAmBxB,2DAA2D;IACpD,KAAK,IAAI,IAAI;IAKpB,oIAAoI;IAC5H,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAI3C,wDAAwD;IACxD,OAAO,CAAE,gBAAgB;IAWzB,oIAAoI;IAC7H,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAIpD,gDAAgD;IAChD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;CACD"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Map implementation using an array of arguments (`any[]`) as its key.
|
|
3
|
+
* Uses a nested Map structure, allowing keys with any JavaScript value.
|
|
4
|
+
* Performance is typically proportional to the number of arguments in the key.
|
|
5
|
+
*
|
|
6
|
+
* @template K - The type of the key (array of any).
|
|
7
|
+
* @template V - The type of the value.
|
|
8
|
+
*/
|
|
9
|
+
export class ArgsMap {
|
|
10
|
+
// Removed: implements Map<K, V>
|
|
11
|
+
root = new Map();
|
|
12
|
+
_size = 0;
|
|
13
|
+
// Special symbol to mark the node holding the actual value for a key array.
|
|
14
|
+
static END_MARKER = Symbol("ArgsMap.end");
|
|
15
|
+
/** Returns the number of key/value pairs in the ArgsMap object. */
|
|
16
|
+
get size() {
|
|
17
|
+
return this._size;
|
|
18
|
+
}
|
|
19
|
+
/** Sets the value for the key in the ArgsMap object. Returns the value. */
|
|
20
|
+
setReturnValue(key, value) {
|
|
21
|
+
this.set(key, value);
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
/** Sets the value for the key in the ArgsMap object. Returns the ArgsMap object. */
|
|
25
|
+
set(key, value) {
|
|
26
|
+
let currentMap = this.root;
|
|
27
|
+
for (const arg of key) {
|
|
28
|
+
let nextNode = currentMap.get(arg);
|
|
29
|
+
// Ensure nextNode is a Map, creating or overwriting if necessary.
|
|
30
|
+
if (!(nextNode instanceof Map))
|
|
31
|
+
currentMap.set(arg, (nextNode = new Map()));
|
|
32
|
+
currentMap = nextNode;
|
|
33
|
+
}
|
|
34
|
+
// Increment size only if this key path is new.
|
|
35
|
+
if (!currentMap.has(ArgsMap.END_MARKER))
|
|
36
|
+
this._size++;
|
|
37
|
+
currentMap.set(ArgsMap.END_MARKER, value);
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
/** Returns the value associated with the key, or undefined if there is none. */
|
|
41
|
+
get(key) {
|
|
42
|
+
let currentMap = this.root;
|
|
43
|
+
for (const arg of key) {
|
|
44
|
+
const nextNode = currentMap.get(arg);
|
|
45
|
+
if (!(nextNode instanceof Map))
|
|
46
|
+
return undefined; // Path doesn't exist
|
|
47
|
+
currentMap = nextNode;
|
|
48
|
+
}
|
|
49
|
+
return currentMap.get(ArgsMap.END_MARKER);
|
|
50
|
+
}
|
|
51
|
+
/** Returns a boolean indicating whether an element with the specified key exists or not. */
|
|
52
|
+
has(key) {
|
|
53
|
+
let currentMap = this.root;
|
|
54
|
+
for (const arg of key) {
|
|
55
|
+
const nextNode = currentMap.get(arg);
|
|
56
|
+
if (!(nextNode instanceof Map))
|
|
57
|
+
return false;
|
|
58
|
+
currentMap = nextNode;
|
|
59
|
+
}
|
|
60
|
+
return currentMap.has(ArgsMap.END_MARKER);
|
|
61
|
+
}
|
|
62
|
+
/** Returns true if an element in the ArgsMap object existed and has been removed, or false if the element does not exist. */
|
|
63
|
+
delete(key) {
|
|
64
|
+
const { deleted } = this._deleteRecursive(this.root, key, 0);
|
|
65
|
+
if (deleted)
|
|
66
|
+
this._size--;
|
|
67
|
+
return deleted;
|
|
68
|
+
}
|
|
69
|
+
/** Recursive helper for delete, cleaning up empty parent maps. */
|
|
70
|
+
_deleteRecursive(currentMap, key, index) {
|
|
71
|
+
if (index === key.length) {
|
|
72
|
+
const deleted = currentMap.delete(ArgsMap.END_MARKER);
|
|
73
|
+
return { deleted, nodeIsEmpty: currentMap.size === 0 };
|
|
74
|
+
}
|
|
75
|
+
const arg = key[index];
|
|
76
|
+
const nextNode = currentMap.get(arg);
|
|
77
|
+
// Key path not found
|
|
78
|
+
if (!(nextNode instanceof Map))
|
|
79
|
+
return { deleted: false, nodeIsEmpty: false };
|
|
80
|
+
const result = this._deleteRecursive(nextNode, key, index + 1);
|
|
81
|
+
// If deletion occurred and the child map became empty, remove it.
|
|
82
|
+
if (result.deleted && result.nodeIsEmpty)
|
|
83
|
+
currentMap.delete(arg);
|
|
84
|
+
return { deleted: result.deleted, nodeIsEmpty: currentMap.size === 0 };
|
|
85
|
+
}
|
|
86
|
+
/** Removes all key/value pairs from the ArgsMap object. */
|
|
87
|
+
clear() {
|
|
88
|
+
this.root.clear();
|
|
89
|
+
this._size = 0;
|
|
90
|
+
}
|
|
91
|
+
/** Returns a new Iterator object that contains the [key, value] pairs for each element in the ArgsMap object in insertion order. */
|
|
92
|
+
*entries() {
|
|
93
|
+
yield* this._traverseEntries([], this.root);
|
|
94
|
+
}
|
|
95
|
+
/** Recursive helper for depth-first entry iteration. */
|
|
96
|
+
*_traverseEntries(currentPath, node) {
|
|
97
|
+
if (node.has(ArgsMap.END_MARKER))
|
|
98
|
+
yield [currentPath, node.get(ArgsMap.END_MARKER)];
|
|
99
|
+
for (const [keyPart, nextNode] of node.entries()) {
|
|
100
|
+
if (keyPart !== ArgsMap.END_MARKER && nextNode instanceof Map) {
|
|
101
|
+
// Recurse with a *new* path array to avoid mutation issues.
|
|
102
|
+
yield* this._traverseEntries([...currentPath, keyPart], nextNode);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/** Returns a new Iterator object that contains the [key, value] pairs for each element in the ArgsMap object in insertion order. */
|
|
107
|
+
[Symbol.iterator]() {
|
|
108
|
+
return this.entries();
|
|
109
|
+
}
|
|
110
|
+
/** Returns a string representing the object. */
|
|
111
|
+
get [Symbol.toStringTag]() {
|
|
112
|
+
return "ArgsMap";
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=ArgsMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArgsMap.js","sourceRoot":"","sources":["../../src/obj/ArgsMap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,OAAO,OAAO;IACnB,gCAAgC;IACf,IAAI,GAAkB,IAAI,GAAG,EAAE,CAAC;IACzC,KAAK,GAAW,CAAC,CAAC;IAC1B,4EAA4E;IACpE,MAAM,CAAU,UAAU,GAAkB,MAAM,CAAC,aAAa,CAAC,CAAC;IAE1E,mEAAmE;IACnE,IAAW,IAAI;QACd,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAED,2EAA2E;IACpE,cAAc,CAAC,GAAM,EAAE,KAAQ;QACrC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrB,OAAO,KAAK,CAAC;IACd,CAAC;IAED,oFAAoF;IAC7E,GAAG,CAAC,GAAM,EAAE,KAAQ;QAC1B,IAAI,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC;QAC3B,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;YACvB,IAAI,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACnC,kEAAkE;YAClE,IAAI,CAAC,CAAC,QAAQ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CAAC;IAED,oIAAoI;IAC7H,CAAC,OAAO;QACd,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IAED,wDAAwD;IAChD,CAAC,gBAAgB,CAAC,WAAc,EAAE,IAAmB;QAC5D,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC;YAAE,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;QAEpF,KAAK,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;YAClD,IAAI,OAAO,KAAK,OAAO,CAAC,UAAU,IAAI,QAAQ,YAAY,GAAG,EAAE,CAAC;gBAC/D,4DAA4D;gBAC5D,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,GAAG,WAAW,EAAE,OAAO,CAAM,EAAE,QAAQ,CAAC,CAAC;YACxE,CAAC;QACF,CAAC;IACF,CAAC;IAED,oIAAoI;IAC7H,CAAC,MAAM,CAAC,QAAQ,CAAC;QACvB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;IAED,gDAAgD;IAChD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACvB,OAAO,SAAS,CAAC;IAClB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Map that uses deep equality to check for key existence.
|
|
3
|
+
* Important if you want to distinguish between objects that serialization does not differentiate.
|
|
4
|
+
*
|
|
5
|
+
* Note performance potentially degrades when the number of entries increases
|
|
6
|
+
* as it has to iterate through all keys if the key isnt immediately in the underlying map.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DequalMap<K extends object, V> extends Map<K, V> {
|
|
9
|
+
private _keys;
|
|
10
|
+
constructor(entries?: ReadonlyArray<readonly [K, V]> | null);
|
|
11
|
+
findKey(key: K): K | undefined;
|
|
12
|
+
set(key: K, value: V): this;
|
|
13
|
+
/** Identical to calling this.set but returns the value instead of this. */
|
|
14
|
+
setReturnValue(key: K, value: V): V;
|
|
15
|
+
get(key: K): V | undefined;
|
|
16
|
+
has(key: K): boolean;
|
|
17
|
+
delete(key: K): boolean;
|
|
18
|
+
clear(): void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=DequalMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DequalMap.d.ts","sourceRoot":"","sources":["../../src/obj/DequalMap.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,qBAAa,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,CAAE,SAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAC5D,OAAO,CAAC,KAAK,CAAqB;gBAEtB,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI;IAOpD,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAO5B,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAWpC,2EAA2E;IAC3E,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;IAK1B,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAK1B,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAIpB,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAQvB,KAAK,IAAI,IAAI;CAItB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { dequal } from "dequal";
|
|
2
|
+
/**
|
|
3
|
+
* A Map that uses deep equality to check for key existence.
|
|
4
|
+
* Important if you want to distinguish between objects that serialization does not differentiate.
|
|
5
|
+
*
|
|
6
|
+
* Note performance potentially degrades when the number of entries increases
|
|
7
|
+
* as it has to iterate through all keys if the key isnt immediately in the underlying map.
|
|
8
|
+
*/
|
|
9
|
+
export class DequalMap extends Map {
|
|
10
|
+
_keys = new Set();
|
|
11
|
+
constructor(entries) {
|
|
12
|
+
super();
|
|
13
|
+
if (entries) {
|
|
14
|
+
for (const [key, value] of entries)
|
|
15
|
+
this.set(key, value);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
findKey(key) {
|
|
19
|
+
if (super.has(key))
|
|
20
|
+
return key;
|
|
21
|
+
for (const storedKey of this._keys) {
|
|
22
|
+
if (dequal(storedKey, key))
|
|
23
|
+
return storedKey;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
set(key, value) {
|
|
27
|
+
const _key = this.findKey(key);
|
|
28
|
+
if (_key !== undefined) {
|
|
29
|
+
super.set(_key, value);
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
super.set(key, value);
|
|
33
|
+
this._keys.add(key);
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
/** Identical to calling this.set but returns the value instead of this. */
|
|
37
|
+
setReturnValue(key, value) {
|
|
38
|
+
this.set(key, value);
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
get(key) {
|
|
42
|
+
const existingKey = this.findKey(key);
|
|
43
|
+
if (existingKey !== undefined)
|
|
44
|
+
return super.get(existingKey);
|
|
45
|
+
}
|
|
46
|
+
has(key) {
|
|
47
|
+
return this.findKey(key) !== undefined;
|
|
48
|
+
}
|
|
49
|
+
delete(key) {
|
|
50
|
+
const _key = this.findKey(key);
|
|
51
|
+
if (_key === undefined)
|
|
52
|
+
return false;
|
|
53
|
+
this._keys.delete(_key);
|
|
54
|
+
super.delete(_key);
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
clear() {
|
|
58
|
+
super.clear();
|
|
59
|
+
this._keys.clear();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|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CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrB,OAAO,KAAK,CAAC;IACd,CAAC;IAEQ,GAAG,CAAC,GAAM;QAClB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,WAAW,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC9D,CAAC;IAEQ,GAAG,CAAC,GAAM;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC;IACxC,CAAC;IAEQ,MAAM,CAAC,GAAM;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QACrC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACxB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACb,CAAC;IAEQ,KAAK;QACb,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CACD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A minimal extension of Map that utilizes JSON.stringify for its keys.
|
|
3
|
+
* This allows using objects as keys, provided they can be consistently stringified.
|
|
4
|
+
* Note: The order of properties in an object affects its JSON string representation.
|
|
5
|
+
* Ensure keys have a consistent property order or structure for reliable lookups.
|
|
6
|
+
*/
|
|
7
|
+
export declare class StringifyMap<K, V> extends Map<string, V> {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new StringifyMap instance.
|
|
10
|
+
* @param entries An iterable of key-value pairs to initialize the map with. Keys will be stringified.
|
|
11
|
+
*/
|
|
12
|
+
constructor(entries?: readonly (readonly [K, V])[] | null);
|
|
13
|
+
/**
|
|
14
|
+
* Returns the value associated with the key, or undefined if there is none.
|
|
15
|
+
* The key is stringified before lookup.
|
|
16
|
+
*/
|
|
17
|
+
get(key: K): V | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Sets the value for the key in the Map object. Returns the Map object.
|
|
20
|
+
* The key is stringified before being stored.
|
|
21
|
+
*/
|
|
22
|
+
set(key: K, value: V): this;
|
|
23
|
+
/**
|
|
24
|
+
* Returns a boolean indicating whether an element with the specified key exists or not.
|
|
25
|
+
* The key is stringified before checking for existence.
|
|
26
|
+
*/
|
|
27
|
+
has(key: K): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Removes the specified element from a Map object by key.
|
|
30
|
+
* Returns true if an element in the Map object existed and has been removed, or false if the element does not exist.
|
|
31
|
+
* The key is stringified before attempting deletion.
|
|
32
|
+
*/
|
|
33
|
+
delete(key: K): boolean;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=StringifyMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringifyMap.d.ts","sourceRoot":"","sources":["../../src/obj/StringifyMap.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,YAAY,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IACrD;;;OAGG;gBACS,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI;IAMzD;;;OAGG;IAEH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAI1B;;;OAGG;IAEH,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAI3B;;;OAGG;IAEH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAIpB;;;;OAIG;IAEH,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;CAGvB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A minimal extension of Map that utilizes JSON.stringify for its keys.
|
|
3
|
+
* This allows using objects as keys, provided they can be consistently stringified.
|
|
4
|
+
* Note: The order of properties in an object affects its JSON string representation.
|
|
5
|
+
* Ensure keys have a consistent property order or structure for reliable lookups.
|
|
6
|
+
*/
|
|
7
|
+
export class StringifyMap extends Map {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new StringifyMap instance.
|
|
10
|
+
* @param entries An iterable of key-value pairs to initialize the map with. Keys will be stringified.
|
|
11
|
+
*/
|
|
12
|
+
constructor(entries) {
|
|
13
|
+
// Convert [K, V] pairs to [string, V] pairs before calling super constructor
|
|
14
|
+
const stringifiedEntries = entries ? Array.from(entries).map(([key, value]) => [JSON.stringify(key), value]) : null;
|
|
15
|
+
super(stringifiedEntries);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns the value associated with the key, or undefined if there is none.
|
|
19
|
+
* The key is stringified before lookup.
|
|
20
|
+
*/
|
|
21
|
+
// @ts-expect-error TS doesnt like me extending Map<string, V> but saying we accept K. K will always be stringified so...
|
|
22
|
+
get(key) {
|
|
23
|
+
return super.get(JSON.stringify(key));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Sets the value for the key in the Map object. Returns the Map object.
|
|
27
|
+
* The key is stringified before being stored.
|
|
28
|
+
*/
|
|
29
|
+
// @ts-expect-error TS doesnt like me extending Map<string, V> but saying we accept K. K will always be stringified so...
|
|
30
|
+
set(key, value) {
|
|
31
|
+
return super.set(JSON.stringify(key), value);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Returns a boolean indicating whether an element with the specified key exists or not.
|
|
35
|
+
* The key is stringified before checking for existence.
|
|
36
|
+
*/
|
|
37
|
+
// @ts-expect-error TS doesnt like me extending Map<string, V> but saying we accept K. K will always be stringified so...
|
|
38
|
+
has(key) {
|
|
39
|
+
return super.has(JSON.stringify(key));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Removes the specified element from a Map object by key.
|
|
43
|
+
* Returns true if an element in the Map object existed and has been removed, or false if the element does not exist.
|
|
44
|
+
* The key is stringified before attempting deletion.
|
|
45
|
+
*/
|
|
46
|
+
// @ts-expect-error TS doesnt like me extending Map<string, V> but saying we accept K. K will always be stringified so...
|
|
47
|
+
delete(key) {
|
|
48
|
+
return super.delete(JSON.stringify(key));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=StringifyMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringifyMap.js","sourceRoot":"","sources":["../../src/obj/StringifyMap.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,OAAO,YAAmB,SAAQ,GAAc;IACrD;;;OAGG;IACH,YAAY,OAA6C;QACxD,6EAA6E;QAC7E,MAAM,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAe,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACjI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACH,yHAAyH;IACzH,GAAG,CAAC,GAAM;QACT,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,yHAAyH;IACzH,GAAG,CAAC,GAAM,EAAE,KAAQ;QACnB,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACH,yHAAyH;IACzH,GAAG,CAAC,GAAM;QACT,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACH,yHAAyH;IACzH,MAAM,CAAC,GAAM;QACZ,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;CACD"}
|
package/dist/ts/types.d.ts
CHANGED
|
@@ -25,11 +25,15 @@ export type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
|
|
25
25
|
export type RequiredOnly<T> = Pick<T, RequiredKeys<T> & keyof T>;
|
|
26
26
|
export type OptionalOnly<T> = Pick<T, OptionalKeys<T> & keyof T>;
|
|
27
27
|
export type AnyKey = string | number | symbol;
|
|
28
|
-
export type UnknownRecord = Record<AnyKey, unknown>;
|
|
29
28
|
export type AnyRecord = Record<AnyKey, any>;
|
|
29
|
+
export type AnyMap = Map<any, any>;
|
|
30
|
+
export type AnyFn = (...args: any[]) => any;
|
|
31
|
+
export type UnknownRecord = Record<AnyKey, unknown>;
|
|
32
|
+
export type UnknownMap = Map<unknown, unknown>;
|
|
33
|
+
export type UnknownFn = (...args: unknown[]) => unknown;
|
|
34
|
+
export type VoidLike = void | undefined;
|
|
30
35
|
export type VoidFn = () => MaybePromise<VoidLike>;
|
|
31
36
|
export type MaybePromise<T> = T | Promise<T>;
|
|
32
|
-
export type VoidLike = void | undefined;
|
|
33
37
|
export type Constructor = abstract new (...args: any) => any;
|
|
34
38
|
export type Primitives = StringConstructor | NumberConstructor | BooleanConstructor;
|
|
35
39
|
export type Primitive<T> = T extends string ? string : T extends StringConstructor ? string : T extends number ? number : T extends NumberConstructor ? number : T extends boolean ? boolean : T extends BooleanConstructor ? boolean : T;
|
package/dist/ts/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ts/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAA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AAM,GACN,CAAC,SAAS,MAAM,GAChB,MAAM,GACN,CAAC,SAAS,iBAAiB,GAC3B,MAAM,GACN,CAAC,SAAS,OAAO,GACjB,OAAO,GACP,CAAC,SAAS,kBAAkB,GAC5B,OAAO,GACP,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inrixia/helpers",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
4
4
|
"description": "Helper functions for various projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,5 +20,8 @@
|
|
|
20
20
|
"rimraf": "^6.0.1",
|
|
21
21
|
"typescript": "^5.8.3"
|
|
22
22
|
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"dequal": "^2.0.3"
|
|
25
|
+
},
|
|
23
26
|
"scripts": {}
|
|
24
27
|
}
|