@stackline/deepmerge 1.0.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/index.js ADDED
@@ -0,0 +1,303 @@
1
+ /*! @stackline/deepmerge v1.0.0 | MIT */
2
+
3
+ // src/index.js
4
+ var objectToString = Object.prototype.toString;
5
+ var hasOwn = Object.prototype.hasOwnProperty;
6
+ var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
7
+ var unsafeKeys = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
8
+ var reactElementType = typeof Symbol === "function" && typeof Symbol.for === "function" ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
9
+ var UnsafeKeyError = class extends TypeError {
10
+ constructor(key, path) {
11
+ const location = formatPath(path.concat(key));
12
+ super(`Refusing to merge unsafe key ${String(key)} at ${location}`);
13
+ this.name = "UnsafeKeyError";
14
+ this.code = "ERR_DEEPMERGE_UNSAFE_KEY";
15
+ this.key = key;
16
+ this.path = location;
17
+ }
18
+ };
19
+ var DeepMergeLimitError = class extends RangeError {
20
+ constructor(kind, limit, path) {
21
+ const location = formatPath(path);
22
+ super(`Deep merge ${kind} limit of ${limit} exceeded at ${location}`);
23
+ this.name = "DeepMergeLimitError";
24
+ this.code = "ERR_DEEPMERGE_LIMIT";
25
+ this.kind = kind;
26
+ this.limit = limit;
27
+ this.path = location;
28
+ }
29
+ };
30
+ function isMergeableObject(value) {
31
+ if (!value || typeof value !== "object") return false;
32
+ const tag = objectToString.call(value);
33
+ if (tag === "[object Date]" || tag === "[object RegExp]") return false;
34
+ return value.$$typeof !== reactElementType;
35
+ }
36
+ function formatPath(path) {
37
+ if (path.length === 0) return "<root>";
38
+ let output = "<root>";
39
+ for (const part of path) {
40
+ if (typeof part === "number") {
41
+ output += `[${part}]`;
42
+ } else if (typeof part === "symbol") {
43
+ output += `[${String(part)}]`;
44
+ } else if (/^[A-Za-z_$][\w$]*$/.test(part)) {
45
+ output += `.${part}`;
46
+ } else {
47
+ output += `[${JSON.stringify(part)}]`;
48
+ }
49
+ }
50
+ return output;
51
+ }
52
+ function defaultArrayMerge(target, source, options) {
53
+ return target.concat(source).map((value) => options.cloneUnlessOtherwiseSpecified(value, options));
54
+ }
55
+ function normalizeLimit(value, fallback, name) {
56
+ const resolved = value === void 0 ? fallback : value;
57
+ if (resolved === Infinity) return resolved;
58
+ if (!Number.isSafeInteger(resolved) || resolved < 0) {
59
+ throw new TypeError(`${name} must be a non-negative safe integer or Infinity`);
60
+ }
61
+ return resolved;
62
+ }
63
+ function createState(inputOptions) {
64
+ if (inputOptions !== void 0 && (inputOptions === null || typeof inputOptions !== "object")) {
65
+ throw new TypeError("options must be an object when provided");
66
+ }
67
+ const input = inputOptions || {};
68
+ const onUnsafeKey = input.onUnsafeKey === void 0 ? "skip" : input.onUnsafeKey;
69
+ if (onUnsafeKey !== "skip" && onUnsafeKey !== "throw") {
70
+ throw new TypeError("onUnsafeKey must be either 'skip' or 'throw'");
71
+ }
72
+ const state = {
73
+ cloneMemo: /* @__PURE__ */ new WeakMap(),
74
+ pairMemo: /* @__PURE__ */ new WeakMap(),
75
+ keyCount: 0,
76
+ callbackDepth: 0,
77
+ options: null
78
+ };
79
+ const options = {
80
+ ...input,
81
+ arrayMerge: input.arrayMerge === void 0 ? defaultArrayMerge : input.arrayMerge,
82
+ isMergeableObject: input.isMergeableObject === void 0 ? isMergeableObject : input.isMergeableObject,
83
+ maxDepth: normalizeLimit(input.maxDepth, 1e3, "maxDepth"),
84
+ maxKeys: normalizeLimit(input.maxKeys, 1e5, "maxKeys"),
85
+ onUnsafeKey
86
+ };
87
+ if (typeof options.arrayMerge !== "function") {
88
+ throw new TypeError("arrayMerge must be a function");
89
+ }
90
+ if (typeof options.isMergeableObject !== "function") {
91
+ throw new TypeError("isMergeableObject must be a function");
92
+ }
93
+ if (options.customMerge !== void 0 && typeof options.customMerge !== "function") {
94
+ throw new TypeError("customMerge must be a function");
95
+ }
96
+ options.cloneUnlessOtherwiseSpecified = (value, callbackOptions) => {
97
+ if (callbackOptions && callbackOptions !== options) {
98
+ const nestedState = createState(callbackOptions);
99
+ return cloneValue(value, nestedState, 0, []);
100
+ }
101
+ return cloneValue(value, state, state.callbackDepth + 1, []);
102
+ };
103
+ state.options = options;
104
+ return state;
105
+ }
106
+ function isWeakKey(value) {
107
+ return value !== null && (typeof value === "object" || typeof value === "function");
108
+ }
109
+ function getPair(state, target, source) {
110
+ if (!isWeakKey(target) || !isWeakKey(source)) return void 0;
111
+ const bySource = state.pairMemo.get(target);
112
+ return bySource && bySource.get(source);
113
+ }
114
+ function rememberPair(state, target, source, destination) {
115
+ if (!isWeakKey(target) || !isWeakKey(source)) return;
116
+ let bySource = state.pairMemo.get(target);
117
+ if (!bySource) {
118
+ bySource = /* @__PURE__ */ new WeakMap();
119
+ state.pairMemo.set(target, bySource);
120
+ }
121
+ bySource.set(source, destination);
122
+ }
123
+ function rememberClone(state, value, destination) {
124
+ if (isWeakKey(value)) state.cloneMemo.set(value, destination);
125
+ }
126
+ function enforceDepth(state, depth, path) {
127
+ if (depth > state.options.maxDepth) {
128
+ throw new DeepMergeLimitError("depth", state.options.maxDepth, path);
129
+ }
130
+ }
131
+ function consumeKeys(state, count, path) {
132
+ state.keyCount += count;
133
+ if (state.keyCount > state.options.maxKeys) {
134
+ throw new DeepMergeLimitError("key", state.options.maxKeys, path);
135
+ }
136
+ }
137
+ function getEnumerableKeys(value) {
138
+ const keys = Object.keys(value);
139
+ if (typeof Object.getOwnPropertySymbols !== "function") return keys;
140
+ return keys.concat(
141
+ Object.getOwnPropertySymbols(Object(value)).filter(
142
+ (symbol) => propertyIsEnumerable.call(value, symbol)
143
+ )
144
+ );
145
+ }
146
+ function isUnsafeKey(key) {
147
+ return typeof key === "string" && unsafeKeys.has(key);
148
+ }
149
+ function shouldSkipKey(key, state, path) {
150
+ if (!isUnsafeKey(key)) return false;
151
+ if (state.options.onUnsafeKey === "throw") {
152
+ throw new UnsafeKeyError(key, path);
153
+ }
154
+ return true;
155
+ }
156
+ function propertyIsOnObject(object, property) {
157
+ try {
158
+ return property in object;
159
+ } catch (e) {
160
+ return false;
161
+ }
162
+ }
163
+ function propertyIsUnsafe(target, key) {
164
+ return propertyIsOnObject(target, key) && !(hasOwn.call(target, key) && propertyIsEnumerable.call(target, key));
165
+ }
166
+ function defineValue(target, key, value) {
167
+ Object.defineProperty(target, key, {
168
+ configurable: true,
169
+ enumerable: true,
170
+ value,
171
+ writable: true
172
+ });
173
+ }
174
+ function cloneValue(value, state, depth, path) {
175
+ if (state.options.clone === false || !state.options.isMergeableObject(value)) {
176
+ return value;
177
+ }
178
+ const remembered = state.cloneMemo.get(value);
179
+ if (remembered !== void 0) return remembered;
180
+ return mergeInternal(Array.isArray(value) ? [] : {}, value, state, depth, path);
181
+ }
182
+ function mergeArrays(target, source, state, depth, path) {
183
+ if (state.options.arrayMerge !== defaultArrayMerge) {
184
+ const previousDepth = state.callbackDepth;
185
+ state.callbackDepth = depth;
186
+ try {
187
+ return state.options.arrayMerge(target, source, state.options);
188
+ } finally {
189
+ state.callbackDepth = previousDepth;
190
+ }
191
+ }
192
+ const remembered = getPair(state, target, source);
193
+ if (remembered !== void 0) return remembered;
194
+ const destination = [];
195
+ rememberPair(state, target, source, destination);
196
+ rememberClone(state, target, destination);
197
+ rememberClone(state, source, destination);
198
+ const combined = target.concat(source);
199
+ destination.length = combined.length;
200
+ for (let index = 0; index < combined.length; index += 1) {
201
+ if (!(index in combined)) continue;
202
+ destination[index] = cloneValue(
203
+ combined[index],
204
+ state,
205
+ depth + 1,
206
+ path.concat(index)
207
+ );
208
+ }
209
+ return destination;
210
+ }
211
+ function getCustomMerge(key, state) {
212
+ if (!state.options.customMerge) return void 0;
213
+ const candidate = state.options.customMerge(key, state.options);
214
+ return typeof candidate === "function" ? candidate : void 0;
215
+ }
216
+ function mergeObjects(target, source, state, depth, path) {
217
+ const remembered = getPair(state, target, source);
218
+ if (remembered !== void 0) return remembered;
219
+ const destination = {};
220
+ rememberPair(state, target, source, destination);
221
+ rememberClone(state, target, destination);
222
+ rememberClone(state, source, destination);
223
+ const targetKeys = state.options.isMergeableObject(target) ? getEnumerableKeys(target) : [];
224
+ const sourceKeys = getEnumerableKeys(source);
225
+ consumeKeys(state, targetKeys.length + sourceKeys.length, path);
226
+ const acceptedSourceKeys = [];
227
+ const acceptedSourceSet = /* @__PURE__ */ new Set();
228
+ for (const key of sourceKeys) {
229
+ if (shouldSkipKey(key, state, path) || propertyIsUnsafe(target, key)) continue;
230
+ acceptedSourceKeys.push(key);
231
+ acceptedSourceSet.add(key);
232
+ }
233
+ for (const key of targetKeys) {
234
+ if (shouldSkipKey(key, state, path) || acceptedSourceSet.has(key)) continue;
235
+ defineValue(
236
+ destination,
237
+ key,
238
+ cloneValue(target[key], state, depth + 1, path.concat(key))
239
+ );
240
+ }
241
+ for (const key of acceptedSourceKeys) {
242
+ const sourceValue = source[key];
243
+ let value;
244
+ if (propertyIsOnObject(target, key) && state.options.isMergeableObject(sourceValue)) {
245
+ const customMerge = getCustomMerge(key, state);
246
+ if (customMerge) {
247
+ const previousDepth = state.callbackDepth;
248
+ state.callbackDepth = depth;
249
+ try {
250
+ value = customMerge(target[key], sourceValue, state.options);
251
+ } finally {
252
+ state.callbackDepth = previousDepth;
253
+ }
254
+ } else {
255
+ value = mergeInternal(
256
+ target[key],
257
+ sourceValue,
258
+ state,
259
+ depth + 1,
260
+ path.concat(key)
261
+ );
262
+ }
263
+ } else {
264
+ value = cloneValue(sourceValue, state, depth + 1, path.concat(key));
265
+ }
266
+ defineValue(destination, key, value);
267
+ }
268
+ return destination;
269
+ }
270
+ function mergeInternal(target, source, state, depth, path) {
271
+ enforceDepth(state, depth, path);
272
+ const sourceIsArray = Array.isArray(source);
273
+ const targetIsArray = Array.isArray(target);
274
+ if (sourceIsArray !== targetIsArray) {
275
+ return cloneValue(source, state, depth + 1, path);
276
+ }
277
+ if (sourceIsArray) return mergeArrays(target, source, state, depth, path);
278
+ return mergeObjects(target, source, state, depth, path);
279
+ }
280
+ function deepmerge(target, source, options) {
281
+ return mergeInternal(target, source, createState(options), 0, []);
282
+ }
283
+ function all(objects, options) {
284
+ if (!Array.isArray(objects)) {
285
+ throw new Error("first argument should be an array");
286
+ }
287
+ return objects.reduce((result, value) => deepmerge(result, value, options), {});
288
+ }
289
+ deepmerge.all = all;
290
+ deepmerge.isMergeableObject = isMergeableObject;
291
+ deepmerge.UnsafeKeyError = UnsafeKeyError;
292
+ deepmerge.DeepMergeLimitError = DeepMergeLimitError;
293
+ deepmerge.deepmerge = deepmerge;
294
+ var index_default = deepmerge;
295
+ export {
296
+ DeepMergeLimitError,
297
+ UnsafeKeyError,
298
+ all,
299
+ deepmerge,
300
+ index_default as default,
301
+ isMergeableObject
302
+ };
303
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.js"],
4
+ "sourcesContent": ["const objectToString = Object.prototype.toString;\nconst hasOwn = Object.prototype.hasOwnProperty;\nconst propertyIsEnumerable = Object.prototype.propertyIsEnumerable;\nconst unsafeKeys = new Set(['__proto__', 'prototype', 'constructor']);\nconst reactElementType =\n typeof Symbol === 'function' && typeof Symbol.for === 'function'\n ? Symbol.for('react.element')\n : 0xeac7;\n\nexport class UnsafeKeyError extends TypeError {\n constructor(key, path) {\n const location = formatPath(path.concat(key));\n super(`Refusing to merge unsafe key ${String(key)} at ${location}`);\n this.name = 'UnsafeKeyError';\n this.code = 'ERR_DEEPMERGE_UNSAFE_KEY';\n this.key = key;\n this.path = location;\n }\n}\n\nexport class DeepMergeLimitError extends RangeError {\n constructor(kind, limit, path) {\n const location = formatPath(path);\n super(`Deep merge ${kind} limit of ${limit} exceeded at ${location}`);\n this.name = 'DeepMergeLimitError';\n this.code = 'ERR_DEEPMERGE_LIMIT';\n this.kind = kind;\n this.limit = limit;\n this.path = location;\n }\n}\n\nexport function isMergeableObject(value) {\n if (!value || typeof value !== 'object') return false;\n\n const tag = objectToString.call(value);\n if (tag === '[object Date]' || tag === '[object RegExp]') return false;\n return value.$$typeof !== reactElementType;\n}\n\nfunction formatPath(path) {\n if (path.length === 0) return '<root>';\n let output = '<root>';\n for (const part of path) {\n if (typeof part === 'number') {\n output += `[${part}]`;\n } else if (typeof part === 'symbol') {\n output += `[${String(part)}]`;\n } else if (/^[A-Za-z_$][\\w$]*$/.test(part)) {\n output += `.${part}`;\n } else {\n output += `[${JSON.stringify(part)}]`;\n }\n }\n return output;\n}\n\nfunction defaultArrayMerge(target, source, options) {\n return target\n .concat(source)\n .map((value) => options.cloneUnlessOtherwiseSpecified(value, options));\n}\n\nfunction normalizeLimit(value, fallback, name) {\n const resolved = value === undefined ? fallback : value;\n if (resolved === Infinity) return resolved;\n if (!Number.isSafeInteger(resolved) || resolved < 0) {\n throw new TypeError(`${name} must be a non-negative safe integer or Infinity`);\n }\n return resolved;\n}\n\nfunction createState(inputOptions) {\n if (\n inputOptions !== undefined &&\n (inputOptions === null || typeof inputOptions !== 'object')\n ) {\n throw new TypeError('options must be an object when provided');\n }\n\n const input = inputOptions || {};\n const onUnsafeKey =\n input.onUnsafeKey === undefined ? 'skip' : input.onUnsafeKey;\n if (onUnsafeKey !== 'skip' && onUnsafeKey !== 'throw') {\n throw new TypeError(\"onUnsafeKey must be either 'skip' or 'throw'\");\n }\n\n const state = {\n cloneMemo: new WeakMap(),\n pairMemo: new WeakMap(),\n keyCount: 0,\n callbackDepth: 0,\n options: null\n };\n\n const options = {\n ...input,\n arrayMerge:\n input.arrayMerge === undefined ? defaultArrayMerge : input.arrayMerge,\n isMergeableObject:\n input.isMergeableObject === undefined\n ? isMergeableObject\n : input.isMergeableObject,\n maxDepth: normalizeLimit(input.maxDepth, 1000, 'maxDepth'),\n maxKeys: normalizeLimit(input.maxKeys, 100000, 'maxKeys'),\n onUnsafeKey\n };\n\n if (typeof options.arrayMerge !== 'function') {\n throw new TypeError('arrayMerge must be a function');\n }\n if (typeof options.isMergeableObject !== 'function') {\n throw new TypeError('isMergeableObject must be a function');\n }\n if (options.customMerge !== undefined && typeof options.customMerge !== 'function') {\n throw new TypeError('customMerge must be a function');\n }\n\n options.cloneUnlessOtherwiseSpecified = (value, callbackOptions) => {\n if (callbackOptions && callbackOptions !== options) {\n const nestedState = createState(callbackOptions);\n return cloneValue(value, nestedState, 0, []);\n }\n return cloneValue(value, state, state.callbackDepth + 1, []);\n };\n state.options = options;\n return state;\n}\n\nfunction isWeakKey(value) {\n return value !== null && (typeof value === 'object' || typeof value === 'function');\n}\n\nfunction getPair(state, target, source) {\n if (!isWeakKey(target) || !isWeakKey(source)) return undefined;\n const bySource = state.pairMemo.get(target);\n return bySource && bySource.get(source);\n}\n\nfunction rememberPair(state, target, source, destination) {\n if (!isWeakKey(target) || !isWeakKey(source)) return;\n let bySource = state.pairMemo.get(target);\n if (!bySource) {\n bySource = new WeakMap();\n state.pairMemo.set(target, bySource);\n }\n bySource.set(source, destination);\n}\n\nfunction rememberClone(state, value, destination) {\n if (isWeakKey(value)) state.cloneMemo.set(value, destination);\n}\n\nfunction enforceDepth(state, depth, path) {\n if (depth > state.options.maxDepth) {\n throw new DeepMergeLimitError('depth', state.options.maxDepth, path);\n }\n}\n\nfunction consumeKeys(state, count, path) {\n state.keyCount += count;\n if (state.keyCount > state.options.maxKeys) {\n throw new DeepMergeLimitError('key', state.options.maxKeys, path);\n }\n}\n\nfunction getEnumerableKeys(value) {\n const keys = Object.keys(value);\n if (typeof Object.getOwnPropertySymbols !== 'function') return keys;\n return keys.concat(\n Object.getOwnPropertySymbols(Object(value)).filter((symbol) =>\n propertyIsEnumerable.call(value, symbol)\n )\n );\n}\n\nfunction isUnsafeKey(key) {\n return typeof key === 'string' && unsafeKeys.has(key);\n}\n\nfunction shouldSkipKey(key, state, path) {\n if (!isUnsafeKey(key)) return false;\n if (state.options.onUnsafeKey === 'throw') {\n throw new UnsafeKeyError(key, path);\n }\n return true;\n}\n\nfunction propertyIsOnObject(object, property) {\n try {\n return property in object;\n } catch {\n return false;\n }\n}\n\nfunction propertyIsUnsafe(target, key) {\n return (\n propertyIsOnObject(target, key) &&\n !(hasOwn.call(target, key) && propertyIsEnumerable.call(target, key))\n );\n}\n\nfunction defineValue(target, key, value) {\n Object.defineProperty(target, key, {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n });\n}\n\nfunction cloneValue(value, state, depth, path) {\n if (state.options.clone === false || !state.options.isMergeableObject(value)) {\n return value;\n }\n\n const remembered = state.cloneMemo.get(value);\n if (remembered !== undefined) return remembered;\n return mergeInternal(Array.isArray(value) ? [] : {}, value, state, depth, path);\n}\n\nfunction mergeArrays(target, source, state, depth, path) {\n if (state.options.arrayMerge !== defaultArrayMerge) {\n const previousDepth = state.callbackDepth;\n state.callbackDepth = depth;\n try {\n return state.options.arrayMerge(target, source, state.options);\n } finally {\n state.callbackDepth = previousDepth;\n }\n }\n\n const remembered = getPair(state, target, source);\n if (remembered !== undefined) return remembered;\n\n const destination = [];\n rememberPair(state, target, source, destination);\n rememberClone(state, target, destination);\n rememberClone(state, source, destination);\n\n const combined = target.concat(source);\n destination.length = combined.length;\n for (let index = 0; index < combined.length; index += 1) {\n if (!(index in combined)) continue;\n destination[index] = cloneValue(\n combined[index],\n state,\n depth + 1,\n path.concat(index)\n );\n }\n return destination;\n}\n\nfunction getCustomMerge(key, state) {\n if (!state.options.customMerge) return undefined;\n const candidate = state.options.customMerge(key, state.options);\n return typeof candidate === 'function' ? candidate : undefined;\n}\n\nfunction mergeObjects(target, source, state, depth, path) {\n const remembered = getPair(state, target, source);\n if (remembered !== undefined) return remembered;\n\n const destination = {};\n rememberPair(state, target, source, destination);\n rememberClone(state, target, destination);\n rememberClone(state, source, destination);\n\n const targetKeys = state.options.isMergeableObject(target)\n ? getEnumerableKeys(target)\n : [];\n const sourceKeys = getEnumerableKeys(source);\n consumeKeys(state, targetKeys.length + sourceKeys.length, path);\n\n const acceptedSourceKeys = [];\n const acceptedSourceSet = new Set();\n for (const key of sourceKeys) {\n if (shouldSkipKey(key, state, path) || propertyIsUnsafe(target, key)) continue;\n acceptedSourceKeys.push(key);\n acceptedSourceSet.add(key);\n }\n\n for (const key of targetKeys) {\n if (shouldSkipKey(key, state, path) || acceptedSourceSet.has(key)) continue;\n defineValue(\n destination,\n key,\n cloneValue(target[key], state, depth + 1, path.concat(key))\n );\n }\n\n for (const key of acceptedSourceKeys) {\n const sourceValue = source[key];\n let value;\n\n if (propertyIsOnObject(target, key) && state.options.isMergeableObject(sourceValue)) {\n const customMerge = getCustomMerge(key, state);\n if (customMerge) {\n const previousDepth = state.callbackDepth;\n state.callbackDepth = depth;\n try {\n value = customMerge(target[key], sourceValue, state.options);\n } finally {\n state.callbackDepth = previousDepth;\n }\n } else {\n value = mergeInternal(\n target[key],\n sourceValue,\n state,\n depth + 1,\n path.concat(key)\n );\n }\n } else {\n value = cloneValue(sourceValue, state, depth + 1, path.concat(key));\n }\n defineValue(destination, key, value);\n }\n\n return destination;\n}\n\nfunction mergeInternal(target, source, state, depth, path) {\n enforceDepth(state, depth, path);\n\n const sourceIsArray = Array.isArray(source);\n const targetIsArray = Array.isArray(target);\n if (sourceIsArray !== targetIsArray) {\n return cloneValue(source, state, depth + 1, path);\n }\n if (sourceIsArray) return mergeArrays(target, source, state, depth, path);\n return mergeObjects(target, source, state, depth, path);\n}\n\nexport function deepmerge(target, source, options) {\n return mergeInternal(target, source, createState(options), 0, []);\n}\n\nexport function all(objects, options) {\n if (!Array.isArray(objects)) {\n throw new Error('first argument should be an array');\n }\n return objects.reduce((result, value) => deepmerge(result, value, options), {});\n}\n\ndeepmerge.all = all;\ndeepmerge.isMergeableObject = isMergeableObject;\ndeepmerge.UnsafeKeyError = UnsafeKeyError;\ndeepmerge.DeepMergeLimitError = DeepMergeLimitError;\ndeepmerge.deepmerge = deepmerge;\n\nexport default deepmerge;\n"],
5
+ "mappings": ";;;AAAA,IAAM,iBAAiB,OAAO,UAAU;AACxC,IAAM,SAAS,OAAO,UAAU;AAChC,IAAM,uBA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;AAAA,UACR,KAAK,OAAO,GAAG;AAAA,QACjB;AAAA,MACF;AAAA,IACF,OAAO;AACL,cAAQ,WAAW,aAAa,OAAO,QAAQ,GAAG,KAAK,OAAO,GAAG,CAAC;AAAA,IACpE;AACA,gBAAY,aAAa,KAAK,KAAK;AAAA,EACrC;AAEA,SAAO;AACT;AAEA,SAAS,cAAc,QAAQ,QAAQ,OAAO,OAAO,MAAM;AACzD,eAAa,OAAO,OAAO,IAAI;AAE/B,QAAM,gBAAgB,MAAM,QAAQ,MAAM;AAC1C,QAAM,gBAAgB,MAAM,QAAQ,MAAM;AAC1C,MAAI,kBAAkB,eAAe;AACnC,WAAO,WAAW,QAAQ,OAAO,QAAQ,GAAG,IAAI;AAAA,EAClD;AACA,MAAI,cAAe,QAAO,YAAY,QAAQ,QAAQ,OAAO,OAAO,IAAI;AACxE,SAAO,aAAa,QAAQ,QAAQ,OAAO,OAAO,IAAI;AACxD;AAEO,SAAS,UAAU,QAAQ,QAAQ,SAAS;AACjD,SAAO,cAAc,QAAQ,QAAQ,YAAY,OAAO,GAAG,GAAG,CAAC,CAAC;AAClE;AAEO,SAAS,IAAI,SAAS,SAAS;AACpC,MAAI,CAAC,MAAM,QAAQ,OAAO,GAAG;AAC3B,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACrD;AACA,SAAO,QAAQ,OAAO,CAAC,QAAQ,UAAU,UAAU,QAAQ,OAAO,OAAO,GAAG,CAAC,CAAC;AAChF;AAEA,UAAU,MAAM;AAChB,UAAU,oBAAoB;AAC9B,UAAU,iBAAiB;AAC3B,UAAU,sBAAsB;AAChC,UAAU,YAAY;AAEtB,IAAO,gBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ /*! @stackline/deepmerge v1.0.0 | MIT */
2
+ var StacklineDeepmergeModule=(()=>{var h=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var N=(e,n)=>{for(var r in n)h(e,r,{get:n[r],enumerable:!0})},V=(e,n,r,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of W(n))!L.call(e,t)&&t!==r&&h(e,t,{get:()=>n[t],enumerable:!(o=C(n,t))||o.enumerable});return e};var z=e=>V(h({},"__esModule",{value:!0}),e);var ne={};N(ne,{DeepMergeLimitError:()=>p,UnsafeKeyError:()=>a,all:()=>P,deepmerge:()=>y,default:()=>ee,isMergeableObject:()=>M});var G=Object.prototype.toString,F=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,J=new Set(["__proto__","prototype","constructor"]),Y=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("react.element"):60103,a=class extends TypeError{constructor(n,r){let o=$(r.concat(n));super(`Refusing to merge unsafe key ${String(n)} at ${o}`),this.name="UnsafeKeyError",this.code="ERR_DEEPMERGE_UNSAFE_KEY",this.key=n,this.path=o}},p=class extends RangeError{constructor(n,r,o){let t=$(o);super(`Deep merge ${n} limit of ${r} exceeded at ${t}`),this.name="DeepMergeLimitError",this.code="ERR_DEEPMERGE_LIMIT",this.kind=n,this.limit=r,this.path=t}};function M(e){if(!e||typeof e!="object")return!1;let n=G.call(e);return n==="[object Date]"||n==="[object RegExp]"?!1:e.$$typeof!==Y}function $(e){if(e.length===0)return"<root>";let n="<root>";for(let r of e)typeof r=="number"?n+=`[${r}]`:typeof r=="symbol"?n+=`[${String(r)}]`:/^[A-Za-z_$][\w$]*$/.test(r)?n+=`.${r}`:n+=`[${JSON.stringify(r)}]`;return n}function A(e,n,r){return e.concat(n).map(o=>r.cloneUnlessOtherwiseSpecified(o,r))}function O(e,n,r){let o=e===void 0?n:e;if(o===1/0)return o;if(!Number.isSafeInteger(o)||o<0)throw new TypeError(`${r} must be a non-negative safe integer or Infinity`);return o}function I(e){if(e!==void 0&&(e===null||typeof e!="object"))throw new TypeError("options must be an object when provided");let n=e||{},r=n.onUnsafeKey===void 0?"skip":n.onUnsafeKey;if(r!=="skip"&&r!=="throw")throw new TypeError("onUnsafeKey must be either 'skip' or 'throw'");let o={cloneMemo:new WeakMap,pairMemo:new WeakMap,keyCount:0,callbackDepth:0,options:null},t={...n,arrayMerge:n.arrayMerge===void 0?A:n.arrayMerge,isMergeableObject:n.isMergeableObject===void 0?M:n.isMergeableObject,maxDepth:O(n.maxDepth,1e3,"maxDepth"),maxKeys:O(n.maxKeys,1e5,"maxKeys"),onUnsafeKey:r};if(typeof t.arrayMerge!="function")throw new TypeError("arrayMerge must be a function");if(typeof t.isMergeableObject!="function")throw new TypeError("isMergeableObject must be a function");if(t.customMerge!==void 0&&typeof t.customMerge!="function")throw new TypeError("customMerge must be a function");return t.cloneUnlessOtherwiseSpecified=(f,i)=>{if(i&&i!==t){let u=I(i);return l(f,u,0,[])}return l(f,o,o.callbackDepth+1,[])},o.options=t,o}function m(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function U(e,n,r){if(!m(n)||!m(r))return;let o=e.pairMemo.get(n);return o&&o.get(r)}function T(e,n,r,o){if(!m(n)||!m(r))return;let t=e.pairMemo.get(n);t||(t=new WeakMap,e.pairMemo.set(n,t)),t.set(r,o)}function g(e,n,r){m(n)&&e.cloneMemo.set(n,r)}function Z(e,n,r){if(n>e.options.maxDepth)throw new p("depth",e.options.maxDepth,r)}function q(e,n,r){if(e.keyCount+=n,e.keyCount>e.options.maxKeys)throw new p("key",e.options.maxKeys,r)}function x(e){let n=Object.keys(e);return typeof Object.getOwnPropertySymbols!="function"?n:n.concat(Object.getOwnPropertySymbols(Object(e)).filter(r=>k.call(e,r)))}function B(e){return typeof e=="string"&&J.has(e)}function D(e,n,r){if(!B(e))return!1;if(n.options.onUnsafeKey==="throw")throw new a(e,r);return!0}function _(e,n){try{return n in e}catch(r){return!1}}function H(e,n){return _(e,n)&&!(F.call(e,n)&&k.call(e,n))}function K(e,n,r){Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0})}function l(e,n,r,o){if(n.options.clone===!1||!n.options.isMergeableObject(e))return e;let t=n.cloneMemo.get(e);return t!==void 0?t:w(Array.isArray(e)?[]:{},e,n,r,o)}function Q(e,n,r,o,t){if(r.options.arrayMerge!==A){let s=r.callbackDepth;r.callbackDepth=o;try{return r.options.arrayMerge(e,n,r.options)}finally{r.callbackDepth=s}}let f=U(r,e,n);if(f!==void 0)return f;let i=[];T(r,e,n,i),g(r,e,i),g(r,n,i);let u=e.concat(n);i.length=u.length;for(let s=0;s<u.length;s+=1)s in u&&(i[s]=l(u[s],r,o+1,t.concat(s)));return i}function X(e,n){if(!n.options.customMerge)return;let r=n.options.customMerge(e,n.options);return typeof r=="function"?r:void 0}function v(e,n,r,o,t){let f=U(r,e,n);if(f!==void 0)return f;let i={};T(r,e,n,i),g(r,e,i),g(r,n,i);let u=r.options.isMergeableObject(e)?x(e):[],s=x(n);q(r,u.length+s.length,t);let E=[],j=new Set;for(let c of s)D(c,r,t)||H(e,c)||(E.push(c),j.add(c));for(let c of u)D(c,r,t)||j.has(c)||K(i,c,l(e[c],r,o+1,t.concat(c)));for(let c of E){let b=n[c],d;if(_(e,c)&&r.options.isMergeableObject(b)){let S=X(c,r);if(S){let R=r.callbackDepth;r.callbackDepth=o;try{d=S(e[c],b,r.options)}finally{r.callbackDepth=R}}else d=w(e[c],b,r,o+1,t.concat(c))}else d=l(b,r,o+1,t.concat(c));K(i,c,d)}return i}function w(e,n,r,o,t){Z(r,o,t);let f=Array.isArray(n),i=Array.isArray(e);return f!==i?l(n,r,o+1,t):f?Q(e,n,r,o,t):v(e,n,r,o,t)}function y(e,n,r){return w(e,n,I(r),0,[])}function P(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((r,o)=>y(r,o,n),{})}y.all=P;y.isMergeableObject=M;y.UnsafeKeyError=a;y.DeepMergeLimitError=p;y.deepmerge=y;var ee=y;return z(ne);})();
3
+ (typeof globalThis !== 'undefined' ? globalThis : window).StacklineDeepmerge = StacklineDeepmergeModule.default;
4
+ //# sourceMappingURL=index.min.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.js"],
4
+ "sourcesContent": ["const objectToString = Object.prototype.toString;\nconst hasOwn = Object.prototype.hasOwnProperty;\nconst propertyIsEnumerable = Object.prototype.propertyIsEnumerable;\nconst unsafeKeys = new Set(['__proto__', 'prototype', 'constructor']);\nconst reactElementType =\n typeof Symbol === 'function' && typeof Symbol.for === 'function'\n ? Symbol.for('react.element')\n : 0xeac7;\n\nexport class UnsafeKeyError extends TypeError {\n constructor(key, path) {\n const location = formatPath(path.concat(key));\n super(`Refusing to merge unsafe key ${String(key)} at ${location}`);\n this.name = 'UnsafeKeyError';\n this.code = 'ERR_DEEPMERGE_UNSAFE_KEY';\n this.key = key;\n this.path = location;\n }\n}\n\nexport class DeepMergeLimitError extends RangeError {\n constructor(kind, limit, path) {\n const location = formatPath(path);\n super(`Deep merge ${kind} limit of ${limit} exceeded at ${location}`);\n this.name = 'DeepMergeLimitError';\n this.code = 'ERR_DEEPMERGE_LIMIT';\n this.kind = kind;\n this.limit = limit;\n this.path = location;\n }\n}\n\nexport function isMergeableObject(value) {\n if (!value || typeof value !== 'object') return false;\n\n const tag = objectToString.call(value);\n if (tag === '[object Date]' || tag === '[object RegExp]') return false;\n return value.$$typeof !== reactElementType;\n}\n\nfunction formatPath(path) {\n if (path.length === 0) return '<root>';\n let output = '<root>';\n for (const part of path) {\n if (typeof part === 'number') {\n output += `[${part}]`;\n } else if (typeof part === 'symbol') {\n output += `[${String(part)}]`;\n } else if (/^[A-Za-z_$][\\w$]*$/.test(part)) {\n output += `.${part}`;\n } else {\n output += `[${JSON.stringify(part)}]`;\n }\n }\n return output;\n}\n\nfunction defaultArrayMerge(target, source, options) {\n return target\n .concat(source)\n .map((value) => options.cloneUnlessOtherwiseSpecified(value, options));\n}\n\nfunction normalizeLimit(value, fallback, name) {\n const resolved = value === undefined ? fallback : value;\n if (resolved === Infinity) return resolved;\n if (!Number.isSafeInteger(resolved) || resolved < 0) {\n throw new TypeError(`${name} must be a non-negative safe integer or Infinity`);\n }\n return resolved;\n}\n\nfunction createState(inputOptions) {\n if (\n inputOptions !== undefined &&\n (inputOptions === null || typeof inputOptions !== 'object')\n ) {\n throw new TypeError('options must be an object when provided');\n }\n\n const input = inputOptions || {};\n const onUnsafeKey =\n input.onUnsafeKey === undefined ? 'skip' : input.onUnsafeKey;\n if (onUnsafeKey !== 'skip' && onUnsafeKey !== 'throw') {\n throw new TypeError(\"onUnsafeKey must be either 'skip' or 'throw'\");\n }\n\n const state = {\n cloneMemo: new WeakMap(),\n pairMemo: new WeakMap(),\n keyCount: 0,\n callbackDepth: 0,\n options: null\n };\n\n const options = {\n ...input,\n arrayMerge:\n input.arrayMerge === undefined ? defaultArrayMerge : input.arrayMerge,\n isMergeableObject:\n input.isMergeableObject === undefined\n ? isMergeableObject\n : input.isMergeableObject,\n maxDepth: normalizeLimit(input.maxDepth, 1000, 'maxDepth'),\n maxKeys: normalizeLimit(input.maxKeys, 100000, 'maxKeys'),\n onUnsafeKey\n };\n\n if (typeof options.arrayMerge !== 'function') {\n throw new TypeError('arrayMerge must be a function');\n }\n if (typeof options.isMergeableObject !== 'function') {\n throw new TypeError('isMergeableObject must be a function');\n }\n if (options.customMerge !== undefined && typeof options.customMerge !== 'function') {\n throw new TypeError('customMerge must be a function');\n }\n\n options.cloneUnlessOtherwiseSpecified = (value, callbackOptions) => {\n if (callbackOptions && callbackOptions !== options) {\n const nestedState = createState(callbackOptions);\n return cloneValue(value, nestedState, 0, []);\n }\n return cloneValue(value, state, state.callbackDepth + 1, []);\n };\n state.options = options;\n return state;\n}\n\nfunction isWeakKey(value) {\n return value !== null && (typeof value === 'object' || typeof value === 'function');\n}\n\nfunction getPair(state, target, source) {\n if (!isWeakKey(target) || !isWeakKey(source)) return undefined;\n const bySource = state.pairMemo.get(target);\n return bySource && bySource.get(source);\n}\n\nfunction rememberPair(state, target, source, destination) {\n if (!isWeakKey(target) || !isWeakKey(source)) return;\n let bySource = state.pairMemo.get(target);\n if (!bySource) {\n bySource = new WeakMap();\n state.pairMemo.set(target, bySource);\n }\n bySource.set(source, destination);\n}\n\nfunction rememberClone(state, value, destination) {\n if (isWeakKey(value)) state.cloneMemo.set(value, destination);\n}\n\nfunction enforceDepth(state, depth, path) {\n if (depth > state.options.maxDepth) {\n throw new DeepMergeLimitError('depth', state.options.maxDepth, path);\n }\n}\n\nfunction consumeKeys(state, count, path) {\n state.keyCount += count;\n if (state.keyCount > state.options.maxKeys) {\n throw new DeepMergeLimitError('key', state.options.maxKeys, path);\n }\n}\n\nfunction getEnumerableKeys(value) {\n const keys = Object.keys(value);\n if (typeof Object.getOwnPropertySymbols !== 'function') return keys;\n return keys.concat(\n Object.getOwnPropertySymbols(Object(value)).filter((symbol) =>\n propertyIsEnumerable.call(value, symbol)\n )\n );\n}\n\nfunction isUnsafeKey(key) {\n return typeof key === 'string' && unsafeKeys.has(key);\n}\n\nfunction shouldSkipKey(key, state, path) {\n if (!isUnsafeKey(key)) return false;\n if (state.options.onUnsafeKey === 'throw') {\n throw new UnsafeKeyError(key, path);\n }\n return true;\n}\n\nfunction propertyIsOnObject(object, property) {\n try {\n return property in object;\n } catch {\n return false;\n }\n}\n\nfunction propertyIsUnsafe(target, key) {\n return (\n propertyIsOnObject(target, key) &&\n !(hasOwn.call(target, key) && propertyIsEnumerable.call(target, key))\n );\n}\n\nfunction defineValue(target, key, value) {\n Object.defineProperty(target, key, {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n });\n}\n\nfunction cloneValue(value, state, depth, path) {\n if (state.options.clone === false || !state.options.isMergeableObject(value)) {\n return value;\n }\n\n const remembered = state.cloneMemo.get(value);\n if (remembered !== undefined) return remembered;\n return mergeInternal(Array.isArray(value) ? [] : {}, value, state, depth, path);\n}\n\nfunction mergeArrays(target, source, state, depth, path) {\n if (state.options.arrayMerge !== defaultArrayMerge) {\n const previousDepth = state.callbackDepth;\n state.callbackDepth = depth;\n try {\n return state.options.arrayMerge(target, source, state.options);\n } finally {\n state.callbackDepth = previousDepth;\n }\n }\n\n const remembered = getPair(state, target, source);\n if (remembered !== undefined) return remembered;\n\n const destination = [];\n rememberPair(state, target, source, destination);\n rememberClone(state, target, destination);\n rememberClone(state, source, destination);\n\n const combined = target.concat(source);\n destination.length = combined.length;\n for (let index = 0; index < combined.length; index += 1) {\n if (!(index in combined)) continue;\n destination[index] = cloneValue(\n combined[index],\n state,\n depth + 1,\n path.concat(index)\n );\n }\n return destination;\n}\n\nfunction getCustomMerge(key, state) {\n if (!state.options.customMerge) return undefined;\n const candidate = state.options.customMerge(key, state.options);\n return typeof candidate === 'function' ? candidate : undefined;\n}\n\nfunction mergeObjects(target, source, state, depth, path) {\n const remembered = getPair(state, target, source);\n if (remembered !== undefined) return remembered;\n\n const destination = {};\n rememberPair(state, target, source, destination);\n rememberClone(state, target, destination);\n rememberClone(state, source, destination);\n\n const targetKeys = state.options.isMergeableObject(target)\n ? getEnumerableKeys(target)\n : [];\n const sourceKeys = getEnumerableKeys(source);\n consumeKeys(state, targetKeys.length + sourceKeys.length, path);\n\n const acceptedSourceKeys = [];\n const acceptedSourceSet = new Set();\n for (const key of sourceKeys) {\n if (shouldSkipKey(key, state, path) || propertyIsUnsafe(target, key)) continue;\n acceptedSourceKeys.push(key);\n acceptedSourceSet.add(key);\n }\n\n for (const key of targetKeys) {\n if (shouldSkipKey(key, state, path) || acceptedSourceSet.has(key)) continue;\n defineValue(\n destination,\n key,\n cloneValue(target[key], state, depth + 1, path.concat(key))\n );\n }\n\n for (const key of acceptedSourceKeys) {\n const sourceValue = source[key];\n let value;\n\n if (propertyIsOnObject(target, key) && state.options.isMergeableObject(sourceValue)) {\n const customMerge = getCustomMerge(key, state);\n if (customMerge) {\n const previousDepth = state.callbackDepth;\n state.callbackDepth = depth;\n try {\n value = customMerge(target[key], sourceValue, state.options);\n } finally {\n state.callbackDepth = previousDepth;\n }\n } else {\n value = mergeInternal(\n target[key],\n sourceValue,\n state,\n depth + 1,\n path.concat(key)\n );\n }\n } else {\n value = cloneValue(sourceValue, state, depth + 1, path.concat(key));\n }\n defineValue(destination, key, value);\n }\n\n return destination;\n}\n\nfunction mergeInternal(target, source, state, depth, path) {\n enforceDepth(state, depth, path);\n\n const sourceIsArray = Array.isArray(source);\n const targetIsArray = Array.isArray(target);\n if (sourceIsArray !== targetIsArray) {\n return cloneValue(source, state, depth + 1, path);\n }\n if (sourceIsArray) return mergeArrays(target, source, state, depth, path);\n return mergeObjects(target, source, state, depth, path);\n}\n\nexport function deepmerge(target, source, options) {\n return mergeInternal(target, source, createState(options), 0, []);\n}\n\nexport function all(objects, options) {\n if (!Array.isArray(objects)) {\n throw new Error('first argument should be an array');\n }\n return objects.reduce((result, value) => deepmerge(result, value, options), {});\n}\n\ndeepmerge.all = all;\ndeepmerge.isMergeableObject = isMergeableObject;\ndeepmerge.UnsafeKeyError = UnsafeKeyError;\ndeepmerge.DeepMergeLimitError = DeepMergeLimitError;\ndeepmerge.deepmerge = deepmerge;\n\nexport default deepmerge;\n"],
5
+ "mappings": ";+bAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,yBAAAE,EAAA,mBAAAC,EAAA,QAAAC,EAAA,cAAAC,EAAA,YAAAC,GAAA,sBAAAC,IAAA,IAAMC,EAAiB,OAAO,UAAU,SAClCC,EAAS,OAAO,UAAU,eAC1BC,EAAuB,OAAO,UAAU,qBACxCC,EAAa,IAAI,IAAI,CAAC,YAAa,YAAa,aAAa,CAAC,EAC9DC,EACJ,OAAO,QAAW,YAAc,OAAO,OAAO,KAAQ,WAClD,OAAO,IAAI,eAAe,EAC1B,MAEOT,EAAN,cAA6B,SAAU,CAC5C,YAAYU,EAAKC,EAAM,CACrB,IAAMC,EAAWC,EAAWF,EAAK,OAAOD,CAAG,CAAC,EAC5C,MAAM,gCAAgC,OAAOA,CAAG,CAAC,OAAOE,CAAQ,EAAE,EAClE,KAAK,KAAO,iBACZ,KAAK,KAAO,2BACZ,KAAK,IAAMF,EACX,KAAK,KAAOE,CACd,CACF,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AC,CAClE,CAEO,SAAStB,EAAIyE,EAASnD,EAAS,CACpC,GAAI,CAAC,MAAM,QAAQmD,CAAO,EACxB,MAAM,IAAI,MAAM,mCAAmC,EAErD,OAAOA,EAAQ,OAAO,CAACC,EAAQ3D,IAAUd,EAAUyE,EAAQ3D,EAAOO,CAAO,EAAG,CAAC,CAAC,CAChF,CAEArB,EAAU,IAAMD,EAChBC,EAAU,kBAAoBE,EAC9BF,EAAU,eAAiBF,EAC3BE,EAAU,oBAAsBH,EAChCG,EAAU,UAAYA,EAEtB,IAAOC,GAAQD",
6
+ "names": ["index_exports", "__export", "DeepMergeLimitError", "UnsafeKeyError", "all", "deepmerge", "index_default", "isMergeableObject", "objectToString", "hasOwn", "propertyIsEnumerable", "unsafeKeys", "reactElementType", "key", "path", "location", "formatPath", "kind", "limit", "value", "tag", "output", "part", "defaultArrayMerge", "target", "source", "options", "normalizeLimit", "fallback", "name", "resolved", "createState", "inputOptions", "input", "onUnsafeKey", "state", "callbackOptions", "nestedState", "cloneValue", "isWeakKey", "getPair", "bySource", "rememberPair", "destination", "rememberClone", "enforceDepth", "depth", "consumeKeys", "count", "getEnumerableKeys", "keys", "symbol", "isUnsafeKey", "shouldSkipKey", "propertyIsOnObject", "object", "property", "e", "propertyIsUnsafe", "defineValue", "remembered", "mergeInternal", "mergeArrays", "previousDepth", "combined", "index", "getCustomMerge", "candidate", "mergeObjects", "targetKeys", "sourceKeys", "acceptedSourceKeys", "acceptedSourceSet", "sourceValue", "customMerge", "sourceIsArray", "targetIsArray", "objects", "result"]
7
+ }
package/package.json ADDED
@@ -0,0 +1,99 @@
1
+ {
2
+ "name": "@stackline/deepmerge",
3
+ "version": "1.0.0",
4
+ "description": "Secure, immutable, zero-dependency deep merge with a deepmerge-compatible API for ESM, CommonJS, TypeScript, and browsers",
5
+ "keywords": [
6
+ "deepmerge",
7
+ "deep-merge",
8
+ "merge",
9
+ "object",
10
+ "config",
11
+ "immutable",
12
+ "prototype-pollution",
13
+ "security",
14
+ "typescript",
15
+ "esm",
16
+ "commonjs",
17
+ "browser",
18
+ "zero-dependency"
19
+ ],
20
+ "license": "MIT",
21
+ "author": {
22
+ "name": "Alexandro Paixao Marques",
23
+ "url": "https://github.com/alexandroit"
24
+ },
25
+ "homepage": "https://alexandro.net/docs/vanilla/deepmerge/",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/alexandroit/stackline-deepmerge.git"
29
+ },
30
+ "bugs": {
31
+ "url": "https://github.com/alexandroit/stackline-deepmerge/issues"
32
+ },
33
+ "type": "module",
34
+ "main": "./dist/index.cjs",
35
+ "module": "./dist/index.js",
36
+ "types": "./dist/index.d.ts",
37
+ "unpkg": "./dist/index.min.js",
38
+ "jsdelivr": "./dist/index.min.js",
39
+ "exports": {
40
+ ".": {
41
+ "browser": {
42
+ "types": "./dist/index.d.mts",
43
+ "default": "./dist/index.js"
44
+ },
45
+ "import": {
46
+ "types": "./dist/index.d.mts",
47
+ "default": "./dist/index.js"
48
+ },
49
+ "require": {
50
+ "types": "./dist/index.d.cts",
51
+ "default": "./dist/index.cjs"
52
+ }
53
+ },
54
+ "./package.json": "./package.json"
55
+ },
56
+ "sideEffects": false,
57
+ "engines": {
58
+ "node": ">=14.17.0"
59
+ },
60
+ "files": [
61
+ "dist",
62
+ "CHANGELOG.md",
63
+ "CONTRIBUTING.md",
64
+ "LICENSE",
65
+ "NOTICE",
66
+ "README.md",
67
+ "SECURITY.md"
68
+ ],
69
+ "publishConfig": {
70
+ "access": "public"
71
+ },
72
+ "scripts": {
73
+ "clean": "node scripts/clean.mjs",
74
+ "build": "node scripts/build.mjs",
75
+ "lint": "eslint . && node scripts/check-markdown.mjs",
76
+ "test": "npm run build && npm run lint && npm run test:coverage && npm run test:types && npm run test:package && npm run test:install && npm run test:docs",
77
+ "test:unit": "node --test --test-reporter=spec test/*.test.mjs",
78
+ "test:coverage": "c8 --all --src src --check-coverage --lines 100 --functions 100 --statements 100 --branches 95 node --test test/core.test.mjs test/cycles-limits.test.mjs test/security.test.mjs test/compatibility.test.mjs",
79
+ "test:types": "node scripts/test-types.mjs",
80
+ "test:package": "node --test test/package.test.mjs && node scripts/check-dist.mjs && publint",
81
+ "test:install": "node scripts/smoke-install.mjs",
82
+ "test:docs": "npm run docs:build && node scripts/check-docs.mjs",
83
+ "test:attw": "attw --pack .",
84
+ "audit:dependencies": "npm audit --audit-level=low && npm audit signatures",
85
+ "benchmark": "npm run build && node benchmark/benchmark.mjs",
86
+ "docs:build": "npm run build && node scripts/build-docs.mjs",
87
+ "docs:serve": "node scripts/serve-docs.mjs",
88
+ "prepack": "npm run clean && npm run build && npm run lint && npm run test:coverage && npm run test:types && npm run test:package"
89
+ },
90
+ "devDependencies": {
91
+ "@arethetypeswrong/cli": "0.18.5",
92
+ "c8": "12.0.0",
93
+ "deepmerge": "4.3.1",
94
+ "esbuild": "0.28.2",
95
+ "eslint": "10.8.1",
96
+ "publint": "0.3.23",
97
+ "typescript": "7.0.2"
98
+ }
99
+ }