@idlebox/deepmerge 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 GongT<admin@gongt.me>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # deepmerge
2
+
3
+ 合并两个对象,可以完全自定义如何合并它们。
4
+
5
+ ```ts
6
+ import { deepmerge, type Primitive, type KeyType } from '@idlebox/deepmerge';
7
+ ```
package/lib/index.d.ts ADDED
@@ -0,0 +1,54 @@
1
+ type KeyType = string | number | symbol;
2
+ type FunctionType = (...rest: any[]) => any;
3
+ /**
4
+ * Primitive类型包括:string、number、boolean、null、undefined、BigInt、RegExp、Date、function
5
+ */
6
+ type Primitive = string | number | boolean | null | undefined | bigint | RegExp | Date | FunctionType;
7
+ type MergeFn<T> = (left: T, right: any, keyPath: KeyType[]) => any | undefined;
8
+ type Constructor<T> = new (...args: any[]) => T;
9
+ /**
10
+ * 如果对象有这个属性,则会调用这个函数进行合并
11
+ * 例如:[custom](b, keypath) { return this.value + b.value; }
12
+ */
13
+ export declare const custom: unique symbol;
14
+ /**
15
+ * 所有的keyPath是当前值对应的key
16
+ * 顶级对象本身为 []
17
+ *
18
+ * 所有“right”值不一定和“left”值类型相同,例如尝试合并 {a:1} 和 {a:{b:1}},会调用
19
+ * primitive(1, {b:1}, ['a']);
20
+ * 所有类型的选择均以左侧对象为准
21
+ */
22
+ export interface MergeStrategy {
23
+ /**
24
+ * 合并简单值
25
+ * @param left a中的值
26
+ * @param right b中的值
27
+ * @param keyPath
28
+ */
29
+ primitive?: MergeFn<Primitive>;
30
+ /**
31
+ * 合并数组
32
+ * @param left a中的值
33
+ * @param right b中的值
34
+ * @param keyPath
35
+ * @returns 合并后的数组,如果为undefined,则返回right
36
+ */
37
+ array?: MergeFn<ArrayLike<any>>;
38
+ /**
39
+ * 合并普通对象
40
+ * 其中left一定是其他合并函数无法处理的object类型
41
+ *
42
+ * @param left a中的值
43
+ * @param right b中的值
44
+ * @param keyPath
45
+ */
46
+ object?: MergeFn<object>;
47
+ special?: Map<Constructor<any>, MergeFn<any>>;
48
+ }
49
+ /**
50
+ * 深复制并合并两个对象,原对象不会修改(当然,无法限制options传入的回调)。
51
+ */
52
+ export declare function deepmerge<A, B = any>(a: A, b: B, options?: MergeStrategy): A & B;
53
+ export {};
54
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAExC,KAAK,YAAY,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAC5C;;GAEG;AACH,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,YAAY,CAAC;AAEtG,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,GAAG,GAAG,SAAS,CAAC;AAC/E,KAAK,WAAW,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,MAAM,eAAqC,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC7B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAE/B;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAEhC;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzB,OAAO,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;CAC9C;AAiCD;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,CAAC,GAAG,CAAC,CAEhF"}
package/lib/index.js ADDED
@@ -0,0 +1,70 @@
1
+ /**
2
+ * 如果对象有这个属性,则会调用这个函数进行合并
3
+ * 例如:[custom](b, keypath) { return this.value + b.value; }
4
+ */
5
+ export const custom = Symbol('idlebox/deepmerge/custom');
6
+ function isPrimitive(value) {
7
+ return (value === undefined ||
8
+ value === null ||
9
+ typeof value === 'string' ||
10
+ typeof value === 'number' ||
11
+ typeof value === 'boolean' ||
12
+ typeof value === 'bigint' ||
13
+ typeof value === 'function' ||
14
+ value instanceof RegExp ||
15
+ value instanceof Date);
16
+ }
17
+ const defaults = {
18
+ primitive: (left, right, _keyPath) => {
19
+ return right === undefined ? left : right;
20
+ },
21
+ array: (left, right, _keyPath) => {
22
+ return right === undefined ? left : right;
23
+ },
24
+ special: new Map(),
25
+ };
26
+ /**
27
+ * 深复制并合并两个对象,原对象不会修改(当然,无法限制options传入的回调)。
28
+ */
29
+ export function deepmerge(a, b, options) {
30
+ return _deepmerge(a, b, [], { ...defaults, ...options });
31
+ }
32
+ function _deepmerge(a, b, keypath, options) {
33
+ if (isPrimitive(a)) {
34
+ return options.primitive(a, b, keypath);
35
+ }
36
+ if (custom in a) {
37
+ return a[custom](b, keypath);
38
+ }
39
+ if (options.special.size) {
40
+ const special = options.special.get(a.constructor);
41
+ if (special) {
42
+ return special(a, b, keypath);
43
+ }
44
+ }
45
+ if (Array.isArray(a)) {
46
+ return options.array(a, b, keypath);
47
+ }
48
+ if (!isPlainObject(a)) {
49
+ throw new TypeError(`can not merge object with type ${typeof a} (constructor: ${a.constructor.name})`);
50
+ }
51
+ const objMerged = options.object?.(a, b, keypath);
52
+ if (objMerged !== undefined) {
53
+ return objMerged;
54
+ }
55
+ let copy = {};
56
+ const keys = new Set([...Object.getOwnPropertyNames(a), ...Object.getOwnPropertyNames(b)]);
57
+ for (const key of keys) {
58
+ copy[key] = _deepmerge(a[key], b[key], [...keypath, key], options);
59
+ // console.log('merge: %s %s + %s = %s', key, a[key], b?.[key], copy[key]);
60
+ }
61
+ return copy;
62
+ }
63
+ function isPlainObject(a) {
64
+ // 判断是否为普通对象
65
+ if (typeof a !== 'object' || a === null)
66
+ return false;
67
+ const proto = Object.getPrototypeOf(a);
68
+ return proto === Object.prototype || proto === null;
69
+ }
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAgDzD,SAAS,WAAW,CAAC,KAAU;IAC9B,OAAO,CACN,KAAK,KAAK,SAAS;QACnB,KAAK,KAAK,IAAI;QACd,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,UAAU;QAC3B,KAAK,YAAY,MAAM;QACvB,KAAK,YAAY,IAAI,CACrB,CAAC;AACH,CAAC;AAED,MAAM,QAAQ,GAAqB;IAClC,SAAS,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;QACpC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IAC3C,CAAC;IACD,KAAK,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;QAChC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IAC3C,CAAC;IACD,OAAO,EAAE,IAAI,GAAG,EAAE;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,SAAS,CAAa,CAAI,EAAE,CAAI,EAAE,OAAuB;IACxE,OAAO,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AAC1D,CAAC;AACD,SAAS,UAAU,CAAC,CAAM,EAAE,CAAM,EAAE,OAAkB,EAAE,OAAyB;IAChF,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;QACpB,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;QACjB,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAC1B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QACnD,IAAI,OAAO,EAAE,CAAC;YACb,OAAO,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;QAC/B,CAAC;IACF,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACtB,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,SAAS,CAAC,kCAAkC,OAAO,CAAC,kBAAkB,CAAC,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,CAAC;IACxG,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;IAClD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,IAAI,IAAI,GAAQ,EAAE,CAAC;IACnB,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3F,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;QACnE,2EAA2E;IAC5E,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,aAAa,CAAC,CAAM;IAC5B,YAAY;IACZ,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACvC,OAAO,KAAK,KAAK,MAAM,CAAC,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=basic.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basic.test.d.ts","sourceRoot":"","sources":["../../src/tests/basic.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { expect } from 'chai';
2
+ import { describe, it } from 'mocha';
3
+ import { deepmerge } from '../index.js';
4
+ import { test1a, test1b } from './data.test.js';
5
+ describe('deepmerge', () => {
6
+ const result1 = {
7
+ ...test1a,
8
+ ...test1b,
9
+ };
10
+ it('should merge two objects', () => {
11
+ const result = deepmerge(test1a, test1b);
12
+ expect(result).to.deep.equals(result1);
13
+ });
14
+ it('should merge two objects deeply', () => {
15
+ const result = deepmerge({ a: { b: { c: test1a } } }, { a: { b: { c: test1b } } });
16
+ expect(result).to.deep.equals({ a: { b: { c: result1 } } });
17
+ });
18
+ });
19
+ //# sourceMappingURL=basic.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basic.test.js","sourceRoot":"","sources":["../../src/tests/basic.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEhD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IAC1B,MAAM,OAAO,GAAG;QACf,GAAG,MAAM;QACT,GAAG,MAAM;KACT,CAAC;IAEF,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QACnC,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACzC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QAC1C,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QACnF,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=custom-symbol.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-symbol.test.d.ts","sourceRoot":"","sources":["../../src/tests/custom-symbol.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { expect } from 'chai';
2
+ import { describe, it } from 'mocha';
3
+ import { custom, deepmerge } from '../index.js';
4
+ import { invalid_function } from './data.test.js';
5
+ class Test {
6
+ value;
7
+ constructor(value) {
8
+ this.value = value;
9
+ }
10
+ [custom](b, _keypath) {
11
+ return this.value + ' ' + b.value;
12
+ }
13
+ }
14
+ describe('custom symbol', () => {
15
+ it('should merge', () => {
16
+ const customStrategy = {
17
+ primitive: invalid_function('primitive'),
18
+ array: invalid_function('array'),
19
+ object: invalid_function('object'),
20
+ special: new Map([[Test, invalid_function('special')]]),
21
+ };
22
+ const result = deepmerge(new Test('Hello'), new Test('World'), customStrategy);
23
+ expect(result).to.equals('Hello World');
24
+ });
25
+ });
26
+ //# sourceMappingURL=custom-symbol.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-symbol.test.js","sourceRoot":"","sources":["../../src/tests/custom-symbol.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAsB,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,IAAI;IACU;IAAnB,YAAmB,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IACpC,CAAC,MAAM,CAAC,CAAC,CAAO,EAAE,QAAgB;QACjC,OAAO,IAAI,CAAC,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC;IACnC,CAAC;CACD;AAED,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;QACvB,MAAM,cAAc,GAAkB;YACrC,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC;YACxC,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC;YAChC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC;YAClC,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;SACvD,CAAC;QAEF,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC;QAC/E,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=custom.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom.test.d.ts","sourceRoot":"","sources":["../../src/tests/custom.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,45 @@
1
+ import { expect } from 'chai';
2
+ import { describe, it } from 'mocha';
3
+ import { deepmerge } from '../index.js';
4
+ import { invalid_function, test1a, test1b } from './data.test.js';
5
+ describe('custom strategy', () => {
6
+ it('should merge', () => {
7
+ const customStrategy = {
8
+ primitive: (left) => left,
9
+ array: (left) => left,
10
+ object: (left, _right, keypath) => {
11
+ if (keypath.length) {
12
+ return left;
13
+ }
14
+ return undefined;
15
+ },
16
+ };
17
+ const result = deepmerge({ a: test1a }, { a: test1b }, customStrategy);
18
+ expect(result.a).to.equals(test1a);
19
+ });
20
+ });
21
+ describe('custom class', () => {
22
+ it('should merge', () => {
23
+ class CustomClass {
24
+ value;
25
+ constructor(value) {
26
+ this.value = value;
27
+ }
28
+ }
29
+ const customStrategy = {
30
+ primitive: invalid_function('primitive'),
31
+ array: invalid_function('array'),
32
+ object: (left, right, keypath) => {
33
+ if (keypath.length) {
34
+ invalid_function('object')(left, right, keypath);
35
+ }
36
+ return undefined;
37
+ },
38
+ special: new Map([[CustomClass, (left, right) => new CustomClass(left.value + ' ' + right.value)]]),
39
+ };
40
+ const result = deepmerge({ a: new CustomClass('Hello') }, { a: new CustomClass('World') }, customStrategy);
41
+ expect(result.a).to.be.instanceOf(CustomClass);
42
+ expect(result.a.value).to.equals('Hello World');
43
+ });
44
+ });
45
+ //# sourceMappingURL=custom.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom.test.js","sourceRoot":"","sources":["../../src/tests/custom.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,SAAS,EAAsB,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAElE,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;QACvB,MAAM,cAAc,GAAkB;YACrC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;YACzB,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;YACrB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;gBACjC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;oBACpB,OAAO,IAAI,CAAC;gBACb,CAAC;gBACD,OAAO,SAAS,CAAC;YAClB,CAAC;SACD,CAAC;QAEF,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,cAAc,CAAC,CAAC;QACvE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;QACvB,MAAM,WAAW;YACG;YAAnB,YAAmB,KAAa;gBAAb,UAAK,GAAL,KAAK,CAAQ;YAAG,CAAC;SACpC;QAED,MAAM,cAAc,GAAkB;YACrC,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC;YACxC,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC;YAChC,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBAChC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;oBACpB,gBAAgB,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;gBAClD,CAAC;gBACD,OAAO,SAAS,CAAC;YAClB,CAAC;YACD,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACnG,CAAC;QAEF,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;QAC3G,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC/C,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare const test1a: {
2
+ a: null;
3
+ foo: string;
4
+ arr: number[];
5
+ date: Date;
6
+ fn(): number;
7
+ };
8
+ export declare const test1b: {
9
+ b: undefined;
10
+ foo: string;
11
+ arr: number[];
12
+ date: Date;
13
+ fn(): number;
14
+ };
15
+ export declare function invalid_function(name: string): (..._args: any[]) => never;
16
+ //# sourceMappingURL=data.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.test.d.ts","sourceRoot":"","sources":["../../src/tests/data.test.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;CAQlB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;CAQlB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,IACpC,GAAG,OAAO,GAAG,EAAE,WAGvB"}
@@ -0,0 +1,24 @@
1
+ export const test1a = {
2
+ a: null,
3
+ foo: 'bar',
4
+ arr: [1, 2, 3],
5
+ date: new Date('2020-01-01'),
6
+ fn() {
7
+ return 1;
8
+ },
9
+ };
10
+ export const test1b = {
11
+ b: undefined,
12
+ foo: 'baz',
13
+ arr: [4, 5],
14
+ date: new Date('2025-01-01'),
15
+ fn() {
16
+ return 2;
17
+ },
18
+ };
19
+ export function invalid_function(name) {
20
+ return (..._args) => {
21
+ throw new Error(`${name} function should not be called`);
22
+ };
23
+ }
24
+ //# sourceMappingURL=data.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.test.js","sourceRoot":"","sources":["../../src/tests/data.test.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACrB,CAAC,EAAE,IAAI;IACP,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACd,IAAI,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;IAC5B,EAAE;QACD,OAAO,CAAC,CAAC;IACV,CAAC;CACD,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG;IACrB,CAAC,EAAE,SAAS;IACZ,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;IAC5B,EAAE;QACD,OAAO,CAAC,CAAC;IACV,CAAC;CACD,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC5C,OAAO,CAAC,GAAG,KAAY,EAAE,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,gCAAgC,CAAC,CAAC;IAC1D,CAAC,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2024.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2024.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2024.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.esnext.array.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/index.ts","../../../node_modules/.pnpm/@types+deep-eql@4.0.2/node_modules/@types/deep-eql/index.d.ts","../../../node_modules/.pnpm/@types+chai@5.2.2/node_modules/@types/chai/index.d.ts","../../../node_modules/.pnpm/@types+mocha@10.0.10/node_modules/@types/mocha/index.d.ts","../src/tests/data.test.ts","../src/tests/basic.test.ts","../src/tests/custom-symbol.test.ts","../src/tests/custom.test.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/utility.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/header.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/readable.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/fetch.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/formdata.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/connector.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/client.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/errors.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/dispatcher.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/global-origin.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/pool-stats.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/pool.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/handlers.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/h2c-client.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/agent.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/mock-call-history.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/mock-agent.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/mock-client.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/mock-pool.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/mock-errors.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/retry-handler.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/retry-agent.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/api.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/cache-interceptor.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/interceptors.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/util.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/cookies.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/patch.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/websocket.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/eventsource.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/content-type.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/cache.d.ts","../../../node_modules/.pnpm/undici-types@7.8.0/node_modules/undici-types/index.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/globals.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/assert.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/assert/strict.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/async_hooks.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/buffer.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/child_process.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/cluster.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/console.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/constants.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/crypto.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/dgram.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/dns.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/dns/promises.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/domain.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/dom-events.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/events.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/fs.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/fs/promises.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/http.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/http2.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/https.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/inspector.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/module.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/net.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/os.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/path.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/process.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/punycode.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/querystring.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/readline.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/readline/promises.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/repl.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/sea.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/sqlite.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/stream.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/stream/promises.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/stream/web.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/string_decoder.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/test.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/timers.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/timers/promises.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/tls.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/trace_events.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/tty.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/url.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/util.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/v8.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/vm.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/wasi.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/worker_threads.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/zlib.d.ts","../../../node_modules/.pnpm/@types+node@24.0.14/node_modules/@types/node/index.d.ts"],"fileIdsList":[[89,133],[79,81,82,83,89,133],[80,89,133],[89,130,133],[89,132,133],[133],[89,133,138,168],[89,133,134,139,145,146,153,165,176],[89,133,134,135,145,153],[89,133,136,177],[89,133,137,138,146,154],[89,133,138,165,173],[89,133,139,141,145,153],[89,132,133,140],[89,133,141,142],[89,133,143,145],[89,132,133,145],[89,133,145,146,147,165,176],[89,133,145,146,147,160,165,168],[89,128,133],[89,128,133,141,145,148,153,165,176],[89,133,145,146,148,149,153,165,173,176],[89,133,148,150,165,173,176],[87,88,89,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182],[89,133,145,151],[89,133,152,176],[89,133,141,145,153,165],[89,133,154],[89,133,155],[89,132,133,156],[89,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182],[89,133,158],[89,133,159],[89,133,145,160,161],[89,133,160,162,177,179],[89,133,145,165,166,168],[89,133,167,168],[89,133,165,166],[89,133,168],[89,133,169],[89,130,133,165,170],[89,133,145,171,172],[89,133,171,172],[89,133,138,153,165,173],[89,133,174],[89,133,153,175],[89,133,148,159,176],[89,133,138,177],[89,133,165,178],[89,133,152,179],[89,133,180],[89,133,145,147,156,165,168,176,178,179,181],[89,133,165,182],[89,98,102,133,176],[89,98,133,165,176],[89,133,165],[89,93,133],[89,95,98,133,176],[89,133,153,173],[89,133,183],[89,93,133,183],[89,95,98,133,153,176],[89,90,91,92,94,97,133,145,165,176],[89,98,106,133],[89,91,96,133],[89,98,122,123,133],[89,91,94,98,133,168,176,183],[89,98,133],[89,90,133],[89,93,94,95,96,97,98,99,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,123,124,125,126,127,133],[89,98,115,118,133,141],[89,98,106,107,108,133],[89,96,98,107,109,133],[89,97,133],[89,91,93,98,133],[89,98,102,107,109,133],[89,102,133],[89,96,98,101,133,176],[89,91,95,98,106,133],[89,98,115,133],[89,93,98,122,133,168,181,183]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"8bf8b5e44e3c9c36f98e1007e8b7018c0f38d8adc07aecef42f5200114547c70","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"60037901da1a425516449b9a20073aa03386cce92f7a1fd902d7602be3a7c2e9","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"22adec94ef7047a6c9d1af3cb96be87a335908bf9ef386ae9fd50eeb37f44c47","affectsGlobalScope":true,"impliedFormat":1},{"version":"4245fee526a7d1754529d19227ecbf3be066ff79ebb6a380d78e41648f2f224d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"3ad031a7abe5174043286b14951a3a9f8fb2444d5636be708a7206b0993daf9b","signature":"e987f611fcfb9e1bec5a71ba5581c97623131a0525242f76bfdd1c138a8a3a31"},{"version":"427fe2004642504828c1476d0af4270e6ad4db6de78c0b5da3e4c5ca95052a99","impliedFormat":1},{"version":"c8905dbea83f3220676a669366cd8c1acef56af4d9d72a8b2241b1d044bb4302","affectsGlobalScope":true,"impliedFormat":99},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1},{"version":"b345ee1e1de28c40ced93ddf9c945675585cde383006468c0b2e108dad90b1b6","signature":"f08f539c031008d05987807875c9495b665a8d143fea995d995a90cc6e1b3007"},{"version":"0f7038e35aa54a3694a0105695ef5388ff809cacee09764068a7350e47628c25","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"22c96342fc9a333e8864db09dd1fecb708c4beb78634f6e12e1879448469fa19","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"a9e6290e090a98b8113c943d7b1c270c78d3cfe9c309d13f0aff73bdd8359665","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0671b50bb99cc7ad46e9c68fa0e7f15ba4bc898b59c31a17ea4611fab5095da","affectsGlobalScope":true,"impliedFormat":1},{"version":"d802f0e6b5188646d307f070d83512e8eb94651858de8a82d1e47f60fb6da4e2","affectsGlobalScope":true,"impliedFormat":1},{"version":"cdcf9ea426ad970f96ac930cd176d5c69c6c24eebd9fc580e1572d6c6a88f62c","impliedFormat":1},{"version":"23cd712e2ce083d68afe69224587438e5914b457b8acf87073c22494d706a3d0","impliedFormat":1},{"version":"487b694c3de27ddf4ad107d4007ad304d29effccf9800c8ae23c2093638d906a","impliedFormat":1},{"version":"e525f9e67f5ddba7b5548430211cae2479070b70ef1fd93550c96c10529457bd","impliedFormat":1},{"version":"ccf4552357ce3c159ef75f0f0114e80401702228f1898bdc9402214c9499e8c0","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"17fe9131bec653b07b0a1a8b99a830216e3e43fe0ea2605be318dc31777c8bbf","impliedFormat":1},{"version":"3c8e93af4d6ce21eb4c8d005ad6dc02e7b5e6781f429d52a35290210f495a674","impliedFormat":1},{"version":"2c9875466123715464539bfd69bcaccb8ff6f3e217809428e0d7bd6323416d01","impliedFormat":1},{"version":"ea6bc8de8b59f90a7a3960005fd01988f98fd0784e14bc6922dde2e93305ec7d","impliedFormat":1},{"version":"36107995674b29284a115e21a0618c4c2751b32a8766dd4cb3ba740308b16d59","impliedFormat":1},{"version":"914a0ae30d96d71915fc519ccb4efbf2b62c0ddfb3a3fc6129151076bc01dc60","impliedFormat":1},{"version":"2472ef4c28971272a897fdb85d4155df022e1f5d9a474a526b8fc2ef598af94e","impliedFormat":1},{"version":"6c8e442ba33b07892169a14f7757321e49ab0f1032d676d321a1fdab8a67d40c","impliedFormat":1},{"version":"b41767d372275c154c7ea6c9d5449d9a741b8ce080f640155cc88ba1763e35b3","impliedFormat":1},{"version":"1cd673d367293fc5cb31cd7bf03d598eb368e4f31f39cf2b908abbaf120ab85a","impliedFormat":1},{"version":"19851a6596401ca52d42117108d35e87230fc21593df5c4d3da7108526b6111c","impliedFormat":1},{"version":"3825bf209f1662dfd039010a27747b73d0ef379f79970b1d05601ec8e8a4249f","impliedFormat":1},{"version":"0b6e25234b4eec6ed96ab138d96eb70b135690d7dd01f3dd8a8ab291c35a683a","impliedFormat":1},{"version":"40bfc70953be2617dc71979c14e9e99c5e65c940a4f1c9759ddb90b0f8ff6b1a","impliedFormat":1},{"version":"da52342062e70c77213e45107921100ba9f9b3a30dd019444cf349e5fb3470c4","impliedFormat":1},{"version":"e9ace91946385d29192766bf783b8460c7dbcbfc63284aa3c9cae6de5155c8bc","impliedFormat":1},{"version":"40b463c6766ca1b689bfcc46d26b5e295954f32ad43e37ee6953c0a677e4ae2b","impliedFormat":1},{"version":"561c60d8bfe0fec2c08827d09ff039eca0c1f9b50ef231025e5a549655ed0298","impliedFormat":1},{"version":"1e30c045732e7db8f7a82cf90b516ebe693d2f499ce2250a977ec0d12e44a529","impliedFormat":1},{"version":"84b736594d8760f43400202859cda55607663090a43445a078963031d47e25e7","impliedFormat":1},{"version":"499e5b055a5aba1e1998f7311a6c441a369831c70905cc565ceac93c28083d53","impliedFormat":1},{"version":"54c3e2371e3d016469ad959697fd257e5621e16296fa67082c2575d0bf8eced0","impliedFormat":1},{"version":"beb8233b2c220cfa0feea31fbe9218d89fa02faa81ef744be8dce5acb89bb1fd","impliedFormat":1},{"version":"78b29846349d4dfdd88bd6650cc5d2baaa67f2e89dc8a80c8e26ef7995386583","impliedFormat":1},{"version":"5d0375ca7310efb77e3ef18d068d53784faf62705e0ad04569597ae0e755c401","impliedFormat":1},{"version":"59af37caec41ecf7b2e76059c9672a49e682c1a2aa6f9d7dc78878f53aa284d6","impliedFormat":1},{"version":"addf417b9eb3f938fddf8d81e96393a165e4be0d4a8b6402292f9c634b1cb00d","impliedFormat":1},{"version":"e38d4fdf79e1eadd92ed7844c331dbaa40f29f21541cfee4e1acff4db09cda33","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"7c10a32ae6f3962672e6869ee2c794e8055d8225ef35c91c0228e354b4e5d2d3","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"99f569b42ea7e7c5fe404b2848c0893f3e1a56e0547c1cd0f74d5dbb9a9de27e","impliedFormat":1},{"version":"f4b4faedc57701ae727d78ba4a83e466a6e3bdcbe40efbf913b17e860642897c","affectsGlobalScope":true,"impliedFormat":1},{"version":"bbcfd9cd76d92c3ee70475270156755346c9086391e1b9cb643d072e0cf576b8","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"72c1f5e0a28e473026074817561d1bc9647909cf253c8d56c41d1df8d95b85f7","impliedFormat":1},{"version":"003ec918ec442c3a4db2c36dc0c9c766977ea1c8bcc1ca7c2085868727c3d3f6","affectsGlobalScope":true,"impliedFormat":1},{"version":"938f94db8400d0b479626b9006245a833d50ce8337f391085fad4af540279567","impliedFormat":1},{"version":"c4e8e8031808b158cfb5ac5c4b38d4a26659aec4b57b6a7e2ba0a141439c208c","impliedFormat":1},{"version":"2c91d8366ff2506296191c26fd97cc1990bab3ee22576275d28b654a21261a44","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"12fb9c13f24845000d7bd9660d11587e27ef967cbd64bd9df19ae3e6aa9b52d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"289e9894a4668c61b5ffed09e196c1f0c2f87ca81efcaebdf6357cfb198dac14","impliedFormat":1},{"version":"25a1105595236f09f5bce42398be9f9ededc8d538c258579ab662d509aa3b98e","impliedFormat":1},{"version":"5078cd62dbdf91ae8b1dc90b1384dec71a9c0932d62bdafb1a811d2a8e26bef2","impliedFormat":1},{"version":"a2e2bbde231b65c53c764c12313897ffdfb6c49183dd31823ee2405f2f7b5378","impliedFormat":1},{"version":"ad1cc0ed328f3f708771272021be61ab146b32ecf2b78f3224959ff1e2cd2a5c","impliedFormat":1},{"version":"71450bbc2d82821d24ca05699a533e72758964e9852062c53b30f31c36978ab8","affectsGlobalScope":true,"impliedFormat":1},{"version":"62f572306e0b173cc5dfc4c583471151f16ef3779cf27ab96922c92ec82a3bc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f32444438ecb1fa4519f6ec3977d69ce0e3acfa18b803e5cd725c204501f350","impliedFormat":1},{"version":"0ab3c844f1eb5a1d94c90edc346a25eb9d3943af7a7812f061bf2d627d8afac0","impliedFormat":1},{"version":"b0a84d9348601dbc217017c0721d6064c3b1af9b392663348ba146fdae0c7afd","impliedFormat":1},{"version":"161f09445a8b4ba07f62ae54b27054e4234e7957062e34c6362300726dabd315","impliedFormat":1},{"version":"77fced47f495f4ff29bb49c52c605c5e73cd9b47d50080133783032769a9d8a6","impliedFormat":1},{"version":"e6057f9e7b0c64d4527afeeada89f313f96a53291705f069a9193c18880578cb","impliedFormat":1},{"version":"34ecb9596317c44dab586118fb62c1565d3dad98d201cd77f3e6b0dde453339c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0f5cda0282e1d18198e2887387eb2f026372ebc4e11c4e4516fef8a19ee4d514","impliedFormat":1},{"version":"e99b0e71f07128fc32583e88ccd509a1aaa9524c290efb2f48c22f9bf8ba83b1","impliedFormat":1},{"version":"76957a6d92b94b9e2852cf527fea32ad2dc0ef50f67fe2b14bd027c9ceef2d86","impliedFormat":1},{"version":"237581f5ec4620a17e791d3bb79bad3af01e27a274dbee875ac9b0721a4fe97d","affectsGlobalScope":true,"impliedFormat":1},{"version":"a8a99a5e6ed33c4a951b67cc1fd5b64fd6ad719f5747845c165ca12f6c21ba16","affectsGlobalScope":true,"impliedFormat":1},{"version":"a58a15da4c5ba3df60c910a043281256fa52d36a0fcdef9b9100c646282e88dd","impliedFormat":1},{"version":"b36beffbf8acdc3ebc58c8bb4b75574b31a2169869c70fc03f82895b93950a12","impliedFormat":1},{"version":"de263f0089aefbfd73c89562fb7254a7468b1f33b61839aafc3f035d60766cb4","impliedFormat":1},{"version":"70b57b5529051497e9f6482b76d91c0dcbb103d9ead8a0549f5bab8f65e5d031","impliedFormat":1},{"version":"e6d81b1f7ab11dc1b1ad7ad29fcfad6904419b36baf55ed5e80df48d56ac3aff","impliedFormat":1},{"version":"1013eb2e2547ad8c100aca52ef9df8c3f209edee32bb387121bb3227f7c00088","impliedFormat":1},{"version":"b6b8e3736383a1d27e2592c484a940eeb37ec4808ba9e74dd57679b2453b5865","impliedFormat":1},{"version":"d6f36b683c59ac0d68a1d5ee906e578e2f5e9a285bca80ff95ce61cdc9ddcdeb","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093","impliedFormat":1},{"version":"12aad38de6f0594dc21efa78a2c1f67bf6a7ef5a389e05417fe9945284450908","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea713aa14a670b1ea0fbaaca4fd204e645f71ca7653a834a8ec07ee889c45de6","impliedFormat":1},{"version":"b338a6e6c1d456e65a6ea78da283e3077fe8edf7202ae10490abbba5b952b05e","impliedFormat":1},{"version":"2918b7c516051c30186a1055ebcdb3580522be7190f8a2fff4100ea714c7c366","affectsGlobalScope":true,"impliedFormat":1},{"version":"ae86f30d5d10e4f75ce8dcb6e1bd3a12ecec3d071a21e8f462c5c85c678efb41","impliedFormat":1},{"version":"982efeb2573605d4e6d5df4dc7e40846bda8b9e678e058fc99522ab6165c479e","impliedFormat":1},{"version":"e03460fe72b259f6d25ad029f085e4bedc3f90477da4401d8fbc1efa9793230e","impliedFormat":1},{"version":"4286a3a6619514fca656089aee160bb6f2e77f4dd53dc5a96b26a0b4fc778055","impliedFormat":1},{"version":"d67fc92a91171632fc74f413ce42ff1aa7fbcc5a85b127101f7ec446d2039a1f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d40e4631100dbc067268bce96b07d7aff7f28a541b1bfb7ef791c64a696b3d33","affectsGlobalScope":true,"impliedFormat":1},{"version":"784490137935e1e38c49b9289110e74a1622baf8a8907888dcbe9e476d7c5e44","impliedFormat":1},{"version":"42180b657831d1b8fead051698618b31da623fb71ff37f002cb9d932cfa775f1","impliedFormat":1},{"version":"4f98d6fb4fe7cbeaa04635c6eaa119d966285d4d39f0eb55b2654187b0b27446","impliedFormat":1},{"version":"e4c653466d0497d87fa9ffd00e59a95f33bc1c1722c3f5c84dab2e950c18da70","affectsGlobalScope":true,"impliedFormat":1},{"version":"e6dcc3b933e864e91d4bea94274ad69854d5d2a1311a4b0e20408a57af19e95d","impliedFormat":1},{"version":"a51f786b9f3c297668f8f322a6c58f85d84948ef69ade32069d5d63ec917221c","impliedFormat":1}],"root":[79,[83,86]],"options":{"allowImportingTsExtensions":false,"allowJs":false,"allowSyntheticDefaultImports":true,"allowUmdGlobalAccess":false,"allowUnreachableCode":false,"allowUnusedLabels":false,"alwaysStrict":true,"assumeChangesOnlyAffectDirectDependencies":false,"checkJs":false,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"emitBOM":false,"emitDeclarationOnly":false,"emitDecoratorMetadata":false,"esModuleInterop":true,"exactOptionalPropertyTypes":false,"experimentalDecorators":false,"importHelpers":true,"inlineSourceMap":false,"inlineSources":false,"jsx":4,"jsxImportSource":"react","module":99,"newLine":1,"noEmitHelpers":false,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitOverride":true,"noImplicitReturns":true,"noImplicitThis":true,"noPropertyAccessFromIndexSignature":false,"noStrictGenericChecks":false,"noUncheckedIndexedAccess":false,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","preserveConstEnums":true,"removeComments":false,"rootDir":"../src","sourceMap":true,"strict":true,"strictBindCallApply":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"stripInternal":false,"target":99,"useDefineForClassFields":true,"useUnknownInCatchVariables":true,"verbatimModuleSyntax":false},"referencedMap":[[79,1],[84,2],[85,2],[86,2],[83,1],[81,3],[80,1],[82,1],[130,4],[131,4],[132,5],[89,6],[133,7],[134,8],[135,9],[87,1],[136,10],[137,11],[138,12],[139,13],[140,14],[141,15],[142,15],[144,1],[143,16],[145,17],[146,18],[147,19],[129,20],[88,1],[148,21],[149,22],[150,23],[183,24],[151,25],[152,26],[153,27],[154,28],[155,29],[156,30],[157,31],[158,32],[159,33],[160,34],[161,34],[162,35],[163,1],[164,1],[165,36],[167,37],[166,38],[168,39],[169,40],[170,41],[171,42],[172,43],[173,44],[174,45],[175,46],[176,47],[177,48],[178,49],[179,50],[180,51],[181,52],[182,53],[77,1],[78,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[23,1],[24,1],[4,1],[25,1],[29,1],[26,1],[27,1],[28,1],[30,1],[31,1],[32,1],[5,1],[33,1],[34,1],[35,1],[36,1],[6,1],[40,1],[37,1],[38,1],[39,1],[41,1],[7,1],[42,1],[47,1],[48,1],[43,1],[44,1],[45,1],[46,1],[8,1],[52,1],[49,1],[50,1],[51,1],[53,1],[9,1],[54,1],[55,1],[56,1],[58,1],[57,1],[59,1],[60,1],[10,1],[61,1],[62,1],[63,1],[11,1],[64,1],[65,1],[66,1],[67,1],[68,1],[1,1],[69,1],[70,1],[12,1],[74,1],[72,1],[76,1],[71,1],[75,1],[73,1],[106,54],[117,55],[104,54],[118,56],[127,57],[96,58],[95,59],[126,60],[121,61],[125,62],[98,63],[114,64],[97,65],[124,66],[93,67],[94,61],[99,68],[100,1],[105,58],[103,68],[91,69],[128,70],[119,71],[109,72],[108,68],[110,73],[112,74],[107,75],[111,76],[122,60],[101,77],[102,78],[113,79],[92,56],[116,80],[115,68],[120,1],[90,1],[123,81]],"latestChangedDtsFile":"./tests/custom.test.d.ts","version":"5.8.3"}
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@idlebox/deepmerge",
3
+ "version": "0.0.1",
4
+ "description": "Deep merge utility for JSON files with custom merge strategies.",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "source": "./src/index.ts",
9
+ "default": "./lib/index.js"
10
+ },
11
+ "./package.json": "./package.json"
12
+ },
13
+ "devDependencies": {
14
+ "@types/node": "^24.0.14",
15
+ "chai": "^5.2.1",
16
+ "mocha": "^11.7.1",
17
+ "rimraf": "^6.0.1",
18
+ "@build-script/single-dog-asset": "^1.0.36",
19
+ "@internal/local-rig": "^1.0.1",
20
+ "@mpis/run": "^0.0.4"
21
+ },
22
+ "license": "MIT",
23
+ "author": "GongT <admin@gongt.me>",
24
+ "repository": "https://github.com/GongT/baobao",
25
+ "main": "./lib/index.js",
26
+ "scripts": {
27
+ "build": "tsc -p src",
28
+ "watch": "tsc -p src --watch",
29
+ "clean": "rimraf lib",
30
+ "lint": "internal-lint"
31
+ }
32
+ }
package/src/index.ts ADDED
@@ -0,0 +1,136 @@
1
+ type KeyType = string | number | symbol;
2
+
3
+ type FunctionType = (...rest: any[]) => any;
4
+ /**
5
+ * Primitive类型包括:string、number、boolean、null、undefined、BigInt、RegExp、Date、function
6
+ */
7
+ type Primitive = string | number | boolean | null | undefined | bigint | RegExp | Date | FunctionType;
8
+
9
+ type MergeFn<T> = (left: T, right: any, keyPath: KeyType[]) => any | undefined;
10
+ type Constructor<T> = new (...args: any[]) => T;
11
+
12
+ /**
13
+ * 如果对象有这个属性,则会调用这个函数进行合并
14
+ * 例如:[custom](b, keypath) { return this.value + b.value; }
15
+ */
16
+ export const custom = Symbol('idlebox/deepmerge/custom');
17
+
18
+ /**
19
+ * 所有的keyPath是当前值对应的key
20
+ * 顶级对象本身为 []
21
+ *
22
+ * 所有“right”值不一定和“left”值类型相同,例如尝试合并 {a:1} 和 {a:{b:1}},会调用
23
+ * primitive(1, {b:1}, ['a']);
24
+ * 所有类型的选择均以左侧对象为准
25
+ */
26
+ export interface MergeStrategy {
27
+ /**
28
+ * 合并简单值
29
+ * @param left a中的值
30
+ * @param right b中的值
31
+ * @param keyPath
32
+ */
33
+ primitive?: MergeFn<Primitive>;
34
+
35
+ /**
36
+ * 合并数组
37
+ * @param left a中的值
38
+ * @param right b中的值
39
+ * @param keyPath
40
+ * @returns 合并后的数组,如果为undefined,则返回right
41
+ */
42
+ array?: MergeFn<ArrayLike<any>>;
43
+
44
+ /**
45
+ * 合并普通对象
46
+ * 其中left一定是其他合并函数无法处理的object类型
47
+ *
48
+ * @param left a中的值
49
+ * @param right b中的值
50
+ * @param keyPath
51
+ */
52
+ object?: MergeFn<object>;
53
+
54
+ special?: Map<Constructor<any>, MergeFn<any>>;
55
+ }
56
+
57
+ interface StrategyRequired {
58
+ primitive: MergeFn<Primitive>;
59
+ array: MergeFn<ArrayLike<any>>;
60
+ object?: MergeFn<object>;
61
+ special: ReadonlyMap<Constructor<any>, MergeFn<any>>;
62
+ }
63
+
64
+ function isPrimitive(value: any): value is Primitive {
65
+ return (
66
+ value === undefined ||
67
+ value === null ||
68
+ typeof value === 'string' ||
69
+ typeof value === 'number' ||
70
+ typeof value === 'boolean' ||
71
+ typeof value === 'bigint' ||
72
+ typeof value === 'function' ||
73
+ value instanceof RegExp ||
74
+ value instanceof Date
75
+ );
76
+ }
77
+
78
+ const defaults: StrategyRequired = {
79
+ primitive: (left, right, _keyPath) => {
80
+ return right === undefined ? left : right;
81
+ },
82
+ array: (left, right, _keyPath) => {
83
+ return right === undefined ? left : right;
84
+ },
85
+ special: new Map(),
86
+ };
87
+
88
+ /**
89
+ * 深复制并合并两个对象,原对象不会修改(当然,无法限制options传入的回调)。
90
+ */
91
+ export function deepmerge<A, B = any>(a: A, b: B, options?: MergeStrategy): A & B {
92
+ return _deepmerge(a, b, [], { ...defaults, ...options });
93
+ }
94
+ function _deepmerge(a: any, b: any, keypath: KeyType[], options: StrategyRequired): any {
95
+ if (isPrimitive(a)) {
96
+ return options.primitive(a, b, keypath);
97
+ }
98
+
99
+ if (custom in a) {
100
+ return a[custom](b, keypath);
101
+ }
102
+
103
+ if (options.special.size) {
104
+ const special = options.special.get(a.constructor);
105
+ if (special) {
106
+ return special(a, b, keypath);
107
+ }
108
+ }
109
+ if (Array.isArray(a)) {
110
+ return options.array(a, b, keypath);
111
+ }
112
+
113
+ if (!isPlainObject(a)) {
114
+ throw new TypeError(`can not merge object with type ${typeof a} (constructor: ${a.constructor.name})`);
115
+ }
116
+
117
+ const objMerged = options.object?.(a, b, keypath);
118
+ if (objMerged !== undefined) {
119
+ return objMerged;
120
+ }
121
+
122
+ let copy: any = {};
123
+ const keys = new Set([...Object.getOwnPropertyNames(a), ...Object.getOwnPropertyNames(b)]);
124
+ for (const key of keys) {
125
+ copy[key] = _deepmerge(a[key], b[key], [...keypath, key], options);
126
+ // console.log('merge: %s %s + %s = %s', key, a[key], b?.[key], copy[key]);
127
+ }
128
+ return copy;
129
+ }
130
+
131
+ function isPlainObject(a: any) {
132
+ // 判断是否为普通对象
133
+ if (typeof a !== 'object' || a === null) return false;
134
+ const proto = Object.getPrototypeOf(a);
135
+ return proto === Object.prototype || proto === null;
136
+ }
@@ -0,0 +1,20 @@
1
+ import { expect } from 'chai';
2
+ import { describe, it } from 'mocha';
3
+ import { deepmerge } from '../index.js';
4
+ import { test1a, test1b } from './data.test.js';
5
+
6
+ describe('deepmerge', () => {
7
+ const result1 = {
8
+ ...test1a,
9
+ ...test1b,
10
+ };
11
+
12
+ it('should merge two objects', () => {
13
+ const result = deepmerge(test1a, test1b);
14
+ expect(result).to.deep.equals(result1);
15
+ });
16
+ it('should merge two objects deeply', () => {
17
+ const result = deepmerge({ a: { b: { c: test1a } } }, { a: { b: { c: test1b } } });
18
+ expect(result).to.deep.equals({ a: { b: { c: result1 } } });
19
+ });
20
+ });
@@ -0,0 +1,25 @@
1
+ import { expect } from 'chai';
2
+ import { describe, it } from 'mocha';
3
+ import { type MergeStrategy, custom, deepmerge } from '../index.js';
4
+ import { invalid_function } from './data.test.js';
5
+
6
+ class Test {
7
+ constructor(public value: string) {}
8
+ [custom](b: Test, _keypath: string) {
9
+ return this.value + ' ' + b.value;
10
+ }
11
+ }
12
+
13
+ describe('custom symbol', () => {
14
+ it('should merge', () => {
15
+ const customStrategy: MergeStrategy = {
16
+ primitive: invalid_function('primitive'),
17
+ array: invalid_function('array'),
18
+ object: invalid_function('object'),
19
+ special: new Map([[Test, invalid_function('special')]]),
20
+ };
21
+
22
+ const result = deepmerge(new Test('Hello'), new Test('World'), customStrategy);
23
+ expect(result).to.equals('Hello World');
24
+ });
25
+ });
@@ -0,0 +1,46 @@
1
+ import { expect } from 'chai';
2
+ import { describe, it } from 'mocha';
3
+ import { deepmerge, type MergeStrategy } from '../index.js';
4
+ import { invalid_function, test1a, test1b } from './data.test.js';
5
+
6
+ describe('custom strategy', () => {
7
+ it('should merge', () => {
8
+ const customStrategy: MergeStrategy = {
9
+ primitive: (left) => left,
10
+ array: (left) => left,
11
+ object: (left, _right, keypath) => {
12
+ if (keypath.length) {
13
+ return left;
14
+ }
15
+ return undefined;
16
+ },
17
+ };
18
+
19
+ const result = deepmerge({ a: test1a }, { a: test1b }, customStrategy);
20
+ expect(result.a).to.equals(test1a);
21
+ });
22
+ });
23
+
24
+ describe('custom class', () => {
25
+ it('should merge', () => {
26
+ class CustomClass {
27
+ constructor(public value: string) {}
28
+ }
29
+
30
+ const customStrategy: MergeStrategy = {
31
+ primitive: invalid_function('primitive'),
32
+ array: invalid_function('array'),
33
+ object: (left, right, keypath) => {
34
+ if (keypath.length) {
35
+ invalid_function('object')(left, right, keypath);
36
+ }
37
+ return undefined;
38
+ },
39
+ special: new Map([[CustomClass, (left, right) => new CustomClass(left.value + ' ' + right.value)]]),
40
+ };
41
+
42
+ const result = deepmerge({ a: new CustomClass('Hello') }, { a: new CustomClass('World') }, customStrategy);
43
+ expect(result.a).to.be.instanceOf(CustomClass);
44
+ expect(result.a.value).to.equals('Hello World');
45
+ });
46
+ });
@@ -0,0 +1,25 @@
1
+ export const test1a = {
2
+ a: null,
3
+ foo: 'bar',
4
+ arr: [1, 2, 3],
5
+ date: new Date('2020-01-01'),
6
+ fn() {
7
+ return 1;
8
+ },
9
+ };
10
+
11
+ export const test1b = {
12
+ b: undefined,
13
+ foo: 'baz',
14
+ arr: [4, 5],
15
+ date: new Date('2025-01-01'),
16
+ fn() {
17
+ return 2;
18
+ },
19
+ };
20
+
21
+ export function invalid_function(name: string) {
22
+ return (..._args: any[]) => {
23
+ throw new Error(`${name} function should not be called`);
24
+ };
25
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "@internal/local-rig/profiles/default/tsconfig.json",
3
+ "compilerOptions": {
4
+ "typeRoots": ["../node_modules/@types", "../node_modules"],
5
+ "outDir": "../lib",
6
+ "rootDir": "./",
7
+ "types": ["node"]
8
+ }
9
+ }