@sandboxed/diff 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/lib/index.js ADDED
@@ -0,0 +1,660 @@
1
+ // src/utils/constants.ts
2
+ var Iterables = /* @__PURE__ */ new Set([Object, Array, Set, Map]);
3
+ var ChangeType = /* @__PURE__ */ ((ChangeType2) => {
4
+ ChangeType2["ADD"] = "add";
5
+ ChangeType2["UPDATE"] = "update";
6
+ ChangeType2["REMOVE"] = "remove";
7
+ ChangeType2["NOOP"] = "noop";
8
+ return ChangeType2;
9
+ })(ChangeType || {});
10
+ var DefaultPathHints = {
11
+ map: "__MAP__",
12
+ set: "__SET__"
13
+ };
14
+ var MAX_DEPTH = 50;
15
+ var MAX_KEYS = 1e3;
16
+ var ITERATION_TIMEOUT_CHECK = 1e3;
17
+ var MAX_TIMEOUT_MS = 1e3;
18
+ var REDACTED = "*****";
19
+
20
+ // src/utils/fns.ts
21
+ function isPrimitive(value) {
22
+ return value !== Object(value);
23
+ }
24
+ function getRawValue(value) {
25
+ if (isPrimitive(value) && typeof value !== "symbol") return value;
26
+ return value.toString();
27
+ }
28
+ function isNullOrUndefined(value) {
29
+ return value === null || value === void 0;
30
+ }
31
+ function isCustomClassInstance(object) {
32
+ if (isNullOrUndefined(object) || typeof object !== "object" || !object.constructor) {
33
+ return false;
34
+ }
35
+ return !object.constructor?.toString?.().includes("[native code]");
36
+ }
37
+ function emptyShellClone(object) {
38
+ if (isCustomClassInstance(object)) {
39
+ return Object.create(Object.getPrototypeOf(object));
40
+ }
41
+ if (isObject(object)) {
42
+ return /* @__PURE__ */ Object.create(null);
43
+ }
44
+ return new object.constructor();
45
+ }
46
+ function getWrapper(obj) {
47
+ let wrapper = ["{", "}"];
48
+ if (Array.isArray(obj)) {
49
+ wrapper = ["[", "]"];
50
+ } else if (isCustomClassInstance(obj)) {
51
+ wrapper = [`${obj.constructor.name} {`, "}"];
52
+ } else if (obj instanceof Map) {
53
+ wrapper = [`Map (${obj.size}) {`, "}"];
54
+ } else if (obj instanceof Set) {
55
+ wrapper = ["Set [", "]"];
56
+ }
57
+ return wrapper;
58
+ }
59
+ function getRef(value) {
60
+ return `ref<${value?.constructor?.name || typeof value}>`;
61
+ }
62
+ function isObject(obj) {
63
+ return obj !== null && typeof obj === "object" && (Object.getPrototypeOf(obj) === Object.prototype || Object.getPrototypeOf(obj) === null);
64
+ }
65
+ function areObjects(a, b) {
66
+ return isObject(a) && isObject(b);
67
+ }
68
+ function getEnumerableKeys(obj) {
69
+ return [...Object.keys(obj), ...Object.getOwnPropertySymbols(obj)];
70
+ }
71
+ function isIterable(obj) {
72
+ return Iterables.has(obj?.constructor) || isObject(obj) || isCustomClassInstance(obj);
73
+ }
74
+
75
+ // src/diff/shared.ts
76
+ function lastPathValue(changeType, value) {
77
+ return { deleted: changeType === "remove" /* REMOVE */, value };
78
+ }
79
+ function includeDiffType(type, config) {
80
+ return config.include?.includes?.(type) && !config.exclude?.includes?.(type);
81
+ }
82
+ function shouldRedactValue(key, config) {
83
+ const rawKey = getRawValue(key);
84
+ return config.redactKeys?.includes?.(rawKey);
85
+ }
86
+ function createReplacer(config) {
87
+ const seen = /* @__PURE__ */ new WeakSet();
88
+ return function replacer(k, v) {
89
+ if (v && typeof v === "object") {
90
+ if (seen.has(v)) return "[Circular]";
91
+ seen.add(v);
92
+ }
93
+ if (v instanceof Set) {
94
+ return `Set ${JSON.stringify([...v.values()], replacer)}`;
95
+ }
96
+ if (v instanceof Map) {
97
+ const entries = [...v.entries()];
98
+ const stringified = entries.map(
99
+ ([key, value]) => `${JSON.stringify(key, replacer)}: ${JSON.stringify(shouldRedactValue(key, config) ? REDACTED : value, replacer)}`
100
+ ).join(", ");
101
+ return `Map (${entries.length}) { ${stringified} }`;
102
+ }
103
+ if (v instanceof Function) {
104
+ return `Function ${v.name || "(anonymous)"}`;
105
+ }
106
+ if (typeof v === "symbol") {
107
+ return v.toString();
108
+ }
109
+ if (typeof v === "bigint") {
110
+ return `BigInt(${v.toString()})`;
111
+ }
112
+ return shouldRedactValue(k, config) ? REDACTED : v;
113
+ };
114
+ }
115
+ function stringify(obj, config) {
116
+ return JSON.stringify(obj, createReplacer(config));
117
+ }
118
+ function getObjectChangeResult(lhs, rhs, depth, key, parsedKey, config, path) {
119
+ const isLhsMap = lhs instanceof Map;
120
+ const isRhsMap = rhs instanceof Map;
121
+ let valueInLhs = lhs?.[key];
122
+ let valueInRhs = rhs?.[key];
123
+ let keyInLhs = Object.hasOwn(lhs, key);
124
+ let keyInRhs = Object.hasOwn(rhs, key);
125
+ if (isLhsMap) {
126
+ valueInLhs = lhs.get(key);
127
+ keyInLhs = lhs.has(key);
128
+ }
129
+ if (isRhsMap) {
130
+ valueInRhs = rhs.get(key);
131
+ keyInRhs = rhs.has(key);
132
+ }
133
+ const redactValue = shouldRedactValue(key, config);
134
+ const rawValueInLhs = getRawValue(valueInLhs);
135
+ const rawValueInRhs = getRawValue(valueInRhs);
136
+ const formattedValueInLhs = JSON.stringify(
137
+ redactValue ? REDACTED : rawValueInLhs,
138
+ createReplacer(config)
139
+ );
140
+ const formattedValueInRhs = JSON.stringify(
141
+ redactValue ? REDACTED : rawValueInRhs,
142
+ createReplacer(config)
143
+ );
144
+ let type = "noop" /* NOOP */;
145
+ let formattedValue = formattedValueInRhs;
146
+ let pathValue = valueInRhs;
147
+ if (!keyInLhs && keyInRhs) {
148
+ type = "add" /* ADD */;
149
+ } else if (keyInLhs && !keyInRhs) {
150
+ type = "remove" /* REMOVE */;
151
+ formattedValue = formattedValueInLhs;
152
+ pathValue = valueInLhs;
153
+ } else if (config.strict ? rawValueInLhs !== rawValueInRhs : rawValueInLhs != rawValueInRhs) {
154
+ type = "update" /* UPDATE */;
155
+ }
156
+ const result = [];
157
+ if (includeDiffType(type, config)) {
158
+ if (type === "update" /* UPDATE */ && !config.showUpdatedOnly) {
159
+ result.push({
160
+ type: "remove" /* REMOVE */,
161
+ str: `${JSON.stringify(parsedKey, createReplacer(config))}: ${formattedValueInLhs},`,
162
+ depth,
163
+ path: [...path, lastPathValue("remove" /* REMOVE */, valueInLhs)]
164
+ });
165
+ }
166
+ result.push({
167
+ type,
168
+ str: `${JSON.stringify(parsedKey, createReplacer(config))}: ${formattedValue},`,
169
+ depth,
170
+ path: [...path, lastPathValue(type, pathValue)]
171
+ });
172
+ }
173
+ return result;
174
+ }
175
+ function getPathHint(config, type) {
176
+ if (typeof config.pathHints === "object") {
177
+ const hint = config.pathHints[type];
178
+ if (typeof hint === "string") return hint;
179
+ }
180
+ return null;
181
+ }
182
+ function buildResult(rhs, result, depth, initialChangeType, parent, path, config) {
183
+ if (!includeDiffType(initialChangeType, config)) return result;
184
+ const parentDepth = depth - 1;
185
+ const [open, close] = getWrapper(rhs);
186
+ return [
187
+ {
188
+ type: initialChangeType,
189
+ str: parentDepth > 0 ? `${stringify(parent, config)}: ${open}` : open,
190
+ depth: parentDepth,
191
+ path
192
+ },
193
+ ...result,
194
+ {
195
+ type: initialChangeType,
196
+ str: parentDepth > 0 ? `${close},` : close,
197
+ depth: parentDepth,
198
+ path
199
+ }
200
+ ];
201
+ }
202
+ function timeoutSecurityCheck(startedAt, config) {
203
+ if (Date.now() - startedAt > config.timeout) {
204
+ throw new Error("Diff took too much time! Aborting.");
205
+ }
206
+ }
207
+ function maxKeysSecurityCheck(size, config) {
208
+ if (size > config.maxKeys) {
209
+ throw new Error("Object is too big to continue! Aborting.");
210
+ }
211
+ }
212
+
213
+ // src/diff/diffObjects.ts
214
+ function diffObjects({
215
+ recursiveDiff: recursiveDiff2,
216
+ lhs,
217
+ rhs,
218
+ config,
219
+ depth,
220
+ parent,
221
+ seen,
222
+ initialChangeType,
223
+ path,
224
+ startedAt
225
+ }) {
226
+ const result = [];
227
+ const lhsKeys = getEnumerableKeys(lhs);
228
+ maxKeysSecurityCheck(lhsKeys.length, config);
229
+ const rhsKeys = getEnumerableKeys(rhs);
230
+ maxKeysSecurityCheck(rhsKeys.length, config);
231
+ const keys = /* @__PURE__ */ new Set([...lhsKeys, ...rhsKeys]);
232
+ let i = 0;
233
+ for (const key of keys) {
234
+ if (i++ % ITERATION_TIMEOUT_CHECK === 0) {
235
+ timeoutSecurityCheck(startedAt, config);
236
+ }
237
+ const lhsValue = Array.isArray(lhs) ? lhs[key] : lhs?.[key];
238
+ const rhsValue = Array.isArray(rhs) ? rhs[key] : rhs?.[key];
239
+ const numericKey = typeof key !== "symbol" ? Number(key) : NaN;
240
+ const parsedKey = isNaN(numericKey) ? key : numericKey;
241
+ const updatedPath = [...path, parsedKey];
242
+ if (isIterable(lhsValue) || isIterable(rhsValue)) {
243
+ result.push(
244
+ ...recursiveDiff2({
245
+ lhs: lhsValue,
246
+ rhs: rhsValue,
247
+ config,
248
+ depth: depth + 1,
249
+ parent: parsedKey,
250
+ seen,
251
+ initialChangeType,
252
+ path: updatedPath,
253
+ startedAt
254
+ })
255
+ );
256
+ continue;
257
+ }
258
+ result.push(
259
+ ...getObjectChangeResult(
260
+ lhs,
261
+ rhs,
262
+ depth,
263
+ key,
264
+ parsedKey,
265
+ config,
266
+ updatedPath
267
+ )
268
+ );
269
+ }
270
+ return buildResult(
271
+ rhs,
272
+ result,
273
+ depth,
274
+ initialChangeType,
275
+ parent,
276
+ path,
277
+ config
278
+ );
279
+ }
280
+ var diffObjects_default = diffObjects;
281
+
282
+ // src/diff/diffSets.ts
283
+ function diffSets({
284
+ recursiveDiff: recursiveDiff2,
285
+ lhs,
286
+ rhs,
287
+ config,
288
+ depth,
289
+ parent,
290
+ seen,
291
+ initialChangeType,
292
+ path,
293
+ startedAt
294
+ }) {
295
+ const result = [];
296
+ maxKeysSecurityCheck(lhs.size, config);
297
+ maxKeysSecurityCheck(rhs.size, config);
298
+ const mergedSet = /* @__PURE__ */ new Set([...lhs, ...rhs]);
299
+ let i = 0;
300
+ for (const value of mergedSet) {
301
+ if (i++ % ITERATION_TIMEOUT_CHECK === 0) {
302
+ timeoutSecurityCheck(startedAt, config);
303
+ }
304
+ const existsInLhs = lhs.has(value);
305
+ const existsInRhs = rhs.has(value);
306
+ const hint = getPathHint(config, "set");
307
+ const updatedPath = [...path];
308
+ if (hint) {
309
+ updatedPath.push(hint);
310
+ }
311
+ if (isIterable(value)) {
312
+ result.push(
313
+ ...recursiveDiff2({
314
+ lhs: existsInLhs ? value : void 0,
315
+ rhs: existsInRhs ? value : void 0,
316
+ config,
317
+ depth: depth + 1,
318
+ parent: getRef(value),
319
+ seen,
320
+ initialChangeType,
321
+ path: updatedPath,
322
+ startedAt
323
+ })
324
+ );
325
+ continue;
326
+ }
327
+ let type = "noop" /* NOOP */;
328
+ if (existsInLhs && !existsInRhs) {
329
+ type = "remove" /* REMOVE */;
330
+ } else if (!existsInLhs && existsInRhs) {
331
+ type = "add" /* ADD */;
332
+ }
333
+ if (includeDiffType(type, config)) {
334
+ result.push({
335
+ type,
336
+ str: `${JSON.stringify(value)},`,
337
+ depth,
338
+ path: [...updatedPath, lastPathValue(type, value)]
339
+ });
340
+ }
341
+ }
342
+ return buildResult(
343
+ rhs,
344
+ result,
345
+ depth,
346
+ initialChangeType,
347
+ parent,
348
+ path,
349
+ config
350
+ );
351
+ }
352
+ var diffSets_default = diffSets;
353
+
354
+ // src/diff/diffMaps.ts
355
+ function diffMaps({
356
+ recursiveDiff: recursiveDiff2,
357
+ lhs,
358
+ rhs,
359
+ config,
360
+ depth,
361
+ parent,
362
+ seen,
363
+ initialChangeType,
364
+ path,
365
+ startedAt
366
+ }) {
367
+ const result = [];
368
+ maxKeysSecurityCheck(lhs.size, config);
369
+ maxKeysSecurityCheck(rhs.size, config);
370
+ const mergedMapKeys = /* @__PURE__ */ new Set([...lhs.keys(), ...rhs.keys()]);
371
+ let i = 0;
372
+ for (const key of mergedMapKeys) {
373
+ if (i++ % ITERATION_TIMEOUT_CHECK === 0) {
374
+ timeoutSecurityCheck(startedAt, config);
375
+ }
376
+ const keyInLhs = lhs.has(key);
377
+ const keyInRhs = rhs.has(key);
378
+ const lhsValue = keyInLhs ? lhs.get(key) : null;
379
+ const rhsValue = keyInRhs ? rhs.get(key) : null;
380
+ const hint = getPathHint(config, "map");
381
+ const pathUpdate = hint ? [hint, key] : [key];
382
+ const updatedPath = [...path, ...pathUpdate];
383
+ if (isIterable(lhsValue) || isIterable(rhsValue)) {
384
+ result.push(
385
+ ...recursiveDiff2({
386
+ lhs: lhsValue,
387
+ rhs: rhsValue,
388
+ config,
389
+ depth: depth + 1,
390
+ parent: key,
391
+ seen,
392
+ initialChangeType,
393
+ path: updatedPath,
394
+ startedAt
395
+ })
396
+ );
397
+ continue;
398
+ }
399
+ result.push(
400
+ ...getObjectChangeResult(lhs, rhs, depth, key, key, config, updatedPath)
401
+ );
402
+ }
403
+ return buildResult(
404
+ rhs,
405
+ result,
406
+ depth,
407
+ initialChangeType,
408
+ parent,
409
+ path,
410
+ config
411
+ );
412
+ }
413
+ var diffMaps_default = diffMaps;
414
+
415
+ // src/diff/diffConstructors.ts
416
+ function diffConstructors({
417
+ recursiveDiff: recursiveDiff2,
418
+ lhs,
419
+ rhs,
420
+ config,
421
+ depth,
422
+ parent,
423
+ seen,
424
+ initialChangeType,
425
+ path,
426
+ startedAt
427
+ }) {
428
+ let modLhs = lhs;
429
+ let modRhs = rhs;
430
+ let defaultChangeType = initialChangeType;
431
+ if (isObject(rhs) || rhs?.constructor) {
432
+ modLhs = emptyShellClone(rhs);
433
+ defaultChangeType = "add" /* ADD */;
434
+ } else if (isObject(lhs) || lhs?.constructor) {
435
+ modRhs = emptyShellClone(lhs);
436
+ defaultChangeType = "remove" /* REMOVE */;
437
+ } else {
438
+ throw new Error("Edge case raised, I don't know how to handle this input");
439
+ }
440
+ return recursiveDiff2({
441
+ lhs: modLhs,
442
+ rhs: modRhs,
443
+ config,
444
+ depth,
445
+ parent,
446
+ seen,
447
+ initialChangeType: defaultChangeType,
448
+ path,
449
+ startedAt
450
+ });
451
+ }
452
+ var diffConstructors_default = diffConstructors;
453
+
454
+ // src/diff/index.ts
455
+ function recursiveDiff({
456
+ lhs,
457
+ rhs,
458
+ config,
459
+ depth,
460
+ parent,
461
+ seen,
462
+ initialChangeType,
463
+ path,
464
+ startedAt
465
+ }) {
466
+ if (depth > config.maxDepth) {
467
+ throw new Error("Max depth exceeded!");
468
+ }
469
+ timeoutSecurityCheck(startedAt, config);
470
+ const lhsSeen = seen.get(lhs) ?? 0;
471
+ const rhsSeen = seen.get(rhs) ?? 0;
472
+ if (lhsSeen > 1 || rhsSeen > 1) {
473
+ if (!includeDiffType(initialChangeType, config)) return [];
474
+ return [
475
+ {
476
+ type: initialChangeType,
477
+ str: `${stringify(parent, config)}: [Circular],`,
478
+ depth: depth - 1,
479
+ path
480
+ }
481
+ ];
482
+ }
483
+ if (typeof lhs === "object" && lhs !== null) seen.set(lhs, lhsSeen + 1);
484
+ if (typeof rhs === "object" && rhs !== null) seen.set(rhs, rhsSeen + 1);
485
+ const args = {
486
+ recursiveDiff,
487
+ lhs,
488
+ rhs,
489
+ config,
490
+ depth,
491
+ parent,
492
+ seen,
493
+ initialChangeType,
494
+ path,
495
+ startedAt
496
+ };
497
+ if (isPrimitive(lhs) && isPrimitive(rhs)) {
498
+ if (config.strict ? lhs === rhs : lhs == rhs) {
499
+ return [];
500
+ }
501
+ const parentDepth = depth - 1;
502
+ const lhsValue = JSON.stringify(lhs, createReplacer(config));
503
+ const rhsValue = JSON.stringify(rhs, createReplacer(config));
504
+ const result = [];
505
+ if (includeDiffType("update" /* UPDATE */, config)) {
506
+ if (!config.showUpdatedOnly) {
507
+ result.push({
508
+ type: "remove" /* REMOVE */,
509
+ str: `${lhsValue}`,
510
+ depth: parentDepth,
511
+ path: [...path, lastPathValue("remove" /* REMOVE */, lhs)]
512
+ });
513
+ }
514
+ result.push({
515
+ type: "update" /* UPDATE */,
516
+ str: `${rhsValue}`,
517
+ depth: parentDepth,
518
+ path: [...path, lastPathValue("update" /* UPDATE */, rhs)]
519
+ });
520
+ }
521
+ return result;
522
+ }
523
+ if (!areObjects(lhs, rhs) && // Skips for Object.create(null) vs {}
524
+ (lhs?.constructor !== rhs?.constructor || isNullOrUndefined(lhs) && rhs || lhs && isNullOrUndefined(rhs))) {
525
+ return diffConstructors_default(args);
526
+ }
527
+ if (lhs instanceof Set && rhs instanceof Set) {
528
+ return diffSets_default(args);
529
+ }
530
+ if (lhs instanceof Map && rhs instanceof Map) {
531
+ return diffMaps_default(args);
532
+ }
533
+ return diffObjects_default(args);
534
+ }
535
+ var diff_default = recursiveDiff;
536
+
537
+ // src/utils/toDiffString.ts
538
+ var ANSI_RESET = "\x1B[0m";
539
+ function colorWrapper(color) {
540
+ return (str) => `${color}${str}${ANSI_RESET}`;
541
+ }
542
+ var ansiColors = {
543
+ ["remove" /* REMOVE */]: colorWrapper("\x1B[31m"),
544
+ ["add" /* ADD */]: colorWrapper("\x1B[32m"),
545
+ ["update" /* UPDATE */]: colorWrapper("\x1B[33m"),
546
+ ["noop" /* NOOP */]: colorWrapper("")
547
+ };
548
+ function toDiffString(diff2, config) {
549
+ const defaultConfig = {
550
+ withColors: true,
551
+ colors: ansiColors,
552
+ wrapper: [],
553
+ indentSize: 2,
554
+ symbols: {
555
+ ["add" /* ADD */]: "+",
556
+ ["remove" /* REMOVE */]: "-",
557
+ ["update" /* UPDATE */]: "!",
558
+ ["noop" /* NOOP */]: ""
559
+ }
560
+ };
561
+ const mergedConfig = {
562
+ ...defaultConfig,
563
+ ...config,
564
+ colors: {
565
+ ...defaultConfig.colors,
566
+ ...config?.colors
567
+ },
568
+ symbols: {
569
+ ...defaultConfig.symbols,
570
+ ...config?.symbols
571
+ }
572
+ };
573
+ const diffString = diff2.map(({ type, str, depth }, index) => {
574
+ let symbolString = mergedConfig.symbols[type];
575
+ if (index > 0 && index < diff2.length - 1 && !symbolString.length) {
576
+ symbolString = ` ${mergedConfig.symbols[type]}`;
577
+ }
578
+ let buildStr = `${symbolString}${" ".repeat(depth * mergedConfig.indentSize)}${str}`;
579
+ if (mergedConfig.withColors) {
580
+ buildStr = mergedConfig.colors[type](buildStr);
581
+ }
582
+ return buildStr;
583
+ }).join("\n");
584
+ const [open = "", close = ""] = mergedConfig.wrapper || [];
585
+ return `${open ? `${open}
586
+ ` : ""}${diffString}${close ? `
587
+ ${close}` : ""}`;
588
+ }
589
+
590
+ // src/index.ts
591
+ function diff(lhs, rhs, config) {
592
+ const defaultConfig = {
593
+ include: [
594
+ "add" /* ADD */,
595
+ "remove" /* REMOVE */,
596
+ "update" /* UPDATE */,
597
+ "noop" /* NOOP */
598
+ ],
599
+ exclude: [],
600
+ strict: true,
601
+ showUpdatedOnly: false,
602
+ pathHints: {
603
+ map: DefaultPathHints.map,
604
+ set: DefaultPathHints.set
605
+ },
606
+ maxDepth: MAX_DEPTH,
607
+ maxKeys: MAX_KEYS,
608
+ timeout: MAX_TIMEOUT_MS,
609
+ redactKeys: [
610
+ "password",
611
+ "secret",
612
+ "token",
613
+ "Symbol(password)",
614
+ "Symbol(secret)",
615
+ "Symbol(token)"
616
+ ]
617
+ };
618
+ const mergedConfig = {
619
+ ...defaultConfig,
620
+ ...config
621
+ };
622
+ if (!mergedConfig.maxDepth) mergedConfig.maxDepth = MAX_DEPTH;
623
+ if (!mergedConfig.maxKeys) mergedConfig.maxKeys = MAX_KEYS;
624
+ if (!mergedConfig.timeout) mergedConfig.timeout = MAX_TIMEOUT_MS;
625
+ mergedConfig.include = Array.isArray(mergedConfig.include) ? mergedConfig.include : [mergedConfig.include];
626
+ mergedConfig.exclude = Array.isArray(mergedConfig.exclude) ? mergedConfig.exclude : [mergedConfig.exclude];
627
+ const diffResult = diff_default({
628
+ lhs,
629
+ rhs,
630
+ config: mergedConfig,
631
+ depth: 1,
632
+ parent: null,
633
+ seen: /* @__PURE__ */ new WeakMap(),
634
+ initialChangeType: "noop" /* NOOP */,
635
+ path: [],
636
+ startedAt: Date.now()
637
+ });
638
+ const areEqual = diffResult.every(
639
+ (result) => result.type === "noop" /* NOOP */
640
+ );
641
+ Object.defineProperty(diffResult, "toDiffString", {
642
+ value: (diffStringConfig) => toDiffString(diffResult, diffStringConfig),
643
+ enumerable: false,
644
+ writable: false,
645
+ configurable: false
646
+ });
647
+ Object.defineProperty(diffResult, "equal", {
648
+ value: areEqual,
649
+ enumerable: false,
650
+ writable: false,
651
+ configurable: false
652
+ });
653
+ return diffResult;
654
+ }
655
+ var index_default = diff;
656
+ export {
657
+ ChangeType,
658
+ index_default as default
659
+ };
660
+ //# sourceMappingURL=index.js.map