@memberjunction/global 2.62.0 → 2.63.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/DeepDiff.d.ts +191 -0
- package/dist/DeepDiff.d.ts.map +1 -0
- package/dist/DeepDiff.js +342 -0
- package/dist/DeepDiff.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Deep difference comparison utility for JavaScript objects
|
|
3
|
+
*
|
|
4
|
+
* This module provides comprehensive utilities to generate detailed diffs between
|
|
5
|
+
* any two JavaScript objects, arrays, or primitive values. It recursively traverses
|
|
6
|
+
* nested structures and produces both machine-readable change objects and human-readable
|
|
7
|
+
* formatted output.
|
|
8
|
+
*
|
|
9
|
+
* Key features:
|
|
10
|
+
* - Deep recursive comparison of objects and arrays
|
|
11
|
+
* - Configurable depth limits and output formatting
|
|
12
|
+
* - Path tracking for nested changes
|
|
13
|
+
* - Summary statistics for change types
|
|
14
|
+
* - Human-readable formatted output
|
|
15
|
+
* - Type-safe change tracking
|
|
16
|
+
*
|
|
17
|
+
* @module @memberjunction/global
|
|
18
|
+
* @author MemberJunction.com
|
|
19
|
+
* @since 2.63.0
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const differ = new DeepDiffer();
|
|
24
|
+
* const diff = differ.diff(
|
|
25
|
+
* { name: 'John', age: 30, hobbies: ['reading'] },
|
|
26
|
+
* { name: 'John', age: 31, hobbies: ['reading', 'gaming'] }
|
|
27
|
+
* );
|
|
28
|
+
* console.log(diff.formatted);
|
|
29
|
+
* // Output:
|
|
30
|
+
* // Modified: age
|
|
31
|
+
* // Changed from 30 to 31
|
|
32
|
+
* // Modified: hobbies
|
|
33
|
+
* // Array length changed from 1 to 2
|
|
34
|
+
* // Added: hobbies[1]
|
|
35
|
+
* // Added "gaming"
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Types of changes that can occur in a deep diff operation
|
|
40
|
+
*/
|
|
41
|
+
export declare enum DiffChangeType {
|
|
42
|
+
/** A new property or value was added */
|
|
43
|
+
Added = "added",
|
|
44
|
+
/** An existing property or value was removed */
|
|
45
|
+
Removed = "removed",
|
|
46
|
+
/** An existing value was changed to a different value */
|
|
47
|
+
Modified = "modified",
|
|
48
|
+
/** No change detected (only included when includeUnchanged is true) */
|
|
49
|
+
Unchanged = "unchanged"
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Represents a single change detected during diff operation
|
|
53
|
+
*/
|
|
54
|
+
export interface DiffChange {
|
|
55
|
+
/** The path to the changed value (e.g., "user.profile.name" or "items[2].id") */
|
|
56
|
+
path: string;
|
|
57
|
+
/** The type of change that occurred */
|
|
58
|
+
type: DiffChangeType;
|
|
59
|
+
/** The original value (undefined for Added changes) */
|
|
60
|
+
oldValue?: any;
|
|
61
|
+
/** The new value (undefined for Removed changes) */
|
|
62
|
+
newValue?: any;
|
|
63
|
+
/** Human-readable description of the change */
|
|
64
|
+
description: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Complete result of a deep diff operation
|
|
68
|
+
*/
|
|
69
|
+
export interface DeepDiffResult {
|
|
70
|
+
/** Array of all detected changes */
|
|
71
|
+
changes: DiffChange[];
|
|
72
|
+
/** Summary statistics about the diff */
|
|
73
|
+
summary: {
|
|
74
|
+
/** Number of properties/values that were added */
|
|
75
|
+
added: number;
|
|
76
|
+
/** Number of properties/values that were removed */
|
|
77
|
+
removed: number;
|
|
78
|
+
/** Number of properties/values that were modified */
|
|
79
|
+
modified: number;
|
|
80
|
+
/** Number of properties/values that remained unchanged (if tracked) */
|
|
81
|
+
unchanged: number;
|
|
82
|
+
/** Total number of paths examined */
|
|
83
|
+
totalPaths: number;
|
|
84
|
+
};
|
|
85
|
+
/** Human-readable formatted diff output suitable for display or logging */
|
|
86
|
+
formatted: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Configuration options for deep diff generation
|
|
90
|
+
*/
|
|
91
|
+
export interface DeepDiffConfig {
|
|
92
|
+
/**
|
|
93
|
+
* Whether to include unchanged paths in the diff results.
|
|
94
|
+
* Useful for seeing the complete structure comparison.
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
97
|
+
includeUnchanged: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Maximum depth to traverse in nested objects.
|
|
100
|
+
* Prevents infinite recursion and controls performance.
|
|
101
|
+
* @default 10
|
|
102
|
+
*/
|
|
103
|
+
maxDepth: number;
|
|
104
|
+
/**
|
|
105
|
+
* Maximum string length before truncation in formatted output.
|
|
106
|
+
* Helps keep the output readable for large text values.
|
|
107
|
+
* @default 100
|
|
108
|
+
*/
|
|
109
|
+
maxStringLength: number;
|
|
110
|
+
/**
|
|
111
|
+
* Whether to include array indices in paths (e.g., "items[0]" vs "items").
|
|
112
|
+
* Provides more precise change tracking for arrays.
|
|
113
|
+
* @default true
|
|
114
|
+
*/
|
|
115
|
+
includeArrayIndices: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Custom value formatter for the formatted output.
|
|
118
|
+
* Allows customization of how values are displayed.
|
|
119
|
+
* @param value - The value to format
|
|
120
|
+
* @param type - The type of the value
|
|
121
|
+
* @returns Formatted string representation
|
|
122
|
+
*/
|
|
123
|
+
valueFormatter?: (value: any, type: string) => string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Deep difference generator for comparing JavaScript objects, arrays, and primitives.
|
|
127
|
+
*
|
|
128
|
+
* This class provides comprehensive comparison capabilities with configurable
|
|
129
|
+
* output formatting and depth control.
|
|
130
|
+
*/
|
|
131
|
+
export declare class DeepDiffer {
|
|
132
|
+
private config;
|
|
133
|
+
/**
|
|
134
|
+
* Creates a new DeepDiffer instance
|
|
135
|
+
* @param config - Optional configuration overrides
|
|
136
|
+
*/
|
|
137
|
+
constructor(config?: Partial<DeepDiffConfig>);
|
|
138
|
+
/**
|
|
139
|
+
* Generate a deep diff between two values
|
|
140
|
+
*
|
|
141
|
+
* @param oldValue - The original value
|
|
142
|
+
* @param newValue - The new value to compare against
|
|
143
|
+
* @returns Complete diff results including changes, summary, and formatted output
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```typescript
|
|
147
|
+
* const differ = new DeepDiffer({ includeUnchanged: true });
|
|
148
|
+
* const result = differ.diff(
|
|
149
|
+
* { users: [{ id: 1, name: 'Alice' }] },
|
|
150
|
+
* { users: [{ id: 1, name: 'Alice Cooper' }] }
|
|
151
|
+
* );
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
diff<T = any>(oldValue: T, newValue: T): DeepDiffResult;
|
|
155
|
+
/**
|
|
156
|
+
* Update configuration options
|
|
157
|
+
* @param config - Partial configuration to merge with existing config
|
|
158
|
+
*/
|
|
159
|
+
updateConfig(config: Partial<DeepDiffConfig>): void;
|
|
160
|
+
/**
|
|
161
|
+
* Recursively generate diff between two values
|
|
162
|
+
* @private
|
|
163
|
+
*/
|
|
164
|
+
private generateDiff;
|
|
165
|
+
/**
|
|
166
|
+
* Compare two arrays and generate diff
|
|
167
|
+
* @private
|
|
168
|
+
*/
|
|
169
|
+
private diffArrays;
|
|
170
|
+
/**
|
|
171
|
+
* Compare two objects and generate diff
|
|
172
|
+
* @private
|
|
173
|
+
*/
|
|
174
|
+
private diffObjects;
|
|
175
|
+
/**
|
|
176
|
+
* Create a human-readable description of a value
|
|
177
|
+
* @private
|
|
178
|
+
*/
|
|
179
|
+
private describeValue;
|
|
180
|
+
/**
|
|
181
|
+
* Get a description of a value for display
|
|
182
|
+
* @private
|
|
183
|
+
*/
|
|
184
|
+
private getValueDescription;
|
|
185
|
+
/**
|
|
186
|
+
* Format the diff results as a human-readable string
|
|
187
|
+
* @private
|
|
188
|
+
*/
|
|
189
|
+
private formatDiff;
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=DeepDiff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeepDiff.d.ts","sourceRoot":"","sources":["../src/DeepDiff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAIH;;GAEG;AACH,oBAAY,cAAc;IACtB,wCAAwC;IACxC,KAAK,UAAU;IACf,gDAAgD;IAChD,OAAO,YAAY;IACnB,yDAAyD;IACzD,QAAQ,aAAa;IACrB,uEAAuE;IACvE,SAAS,cAAc;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,IAAI,EAAE,cAAc,CAAC;IACrB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,oDAAoD;IACpD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,oCAAoC;IACpC,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,wCAAwC;IACxC,OAAO,EAAE;QACL,kDAAkD;QAClD,KAAK,EAAE,MAAM,CAAC;QACd,oDAAoD;QACpD,OAAO,EAAE,MAAM,CAAC;QAChB,qDAAqD;QACrD,QAAQ,EAAE,MAAM,CAAC;QACjB,uEAAuE;QACvE,SAAS,EAAE,MAAM,CAAC;QAClB,qCAAqC;QACrC,UAAU,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B;;;;OAIG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAE7B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACzD;AAED;;;;;GAKG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,MAAM,CAAiB;IAE/B;;;OAGG;gBACS,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;IAU5C;;;;;;;;;;;;;;;OAeG;IACI,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,cAAc;IAkC9D;;;OAGG;IACI,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI;IAI1D;;;OAGG;IACH,OAAO,CAAC,YAAY;IAuDpB;;;OAGG;IACH,OAAO,CAAC,UAAU;IAkDlB;;;OAGG;IACH,OAAO,CAAC,WAAW;IA0BnB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAUrB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IA6B3B;;;OAGG;IACH,OAAO,CAAC,UAAU;CAsCrB"}
|
package/dist/DeepDiff.js
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Deep difference comparison utility for JavaScript objects
|
|
4
|
+
*
|
|
5
|
+
* This module provides comprehensive utilities to generate detailed diffs between
|
|
6
|
+
* any two JavaScript objects, arrays, or primitive values. It recursively traverses
|
|
7
|
+
* nested structures and produces both machine-readable change objects and human-readable
|
|
8
|
+
* formatted output.
|
|
9
|
+
*
|
|
10
|
+
* Key features:
|
|
11
|
+
* - Deep recursive comparison of objects and arrays
|
|
12
|
+
* - Configurable depth limits and output formatting
|
|
13
|
+
* - Path tracking for nested changes
|
|
14
|
+
* - Summary statistics for change types
|
|
15
|
+
* - Human-readable formatted output
|
|
16
|
+
* - Type-safe change tracking
|
|
17
|
+
*
|
|
18
|
+
* @module @memberjunction/global
|
|
19
|
+
* @author MemberJunction.com
|
|
20
|
+
* @since 2.63.0
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const differ = new DeepDiffer();
|
|
25
|
+
* const diff = differ.diff(
|
|
26
|
+
* { name: 'John', age: 30, hobbies: ['reading'] },
|
|
27
|
+
* { name: 'John', age: 31, hobbies: ['reading', 'gaming'] }
|
|
28
|
+
* );
|
|
29
|
+
* console.log(diff.formatted);
|
|
30
|
+
* // Output:
|
|
31
|
+
* // Modified: age
|
|
32
|
+
* // Changed from 30 to 31
|
|
33
|
+
* // Modified: hobbies
|
|
34
|
+
* // Array length changed from 1 to 2
|
|
35
|
+
* // Added: hobbies[1]
|
|
36
|
+
* // Added "gaming"
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
40
|
+
if (k2 === undefined) k2 = k;
|
|
41
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
42
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
43
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
44
|
+
}
|
|
45
|
+
Object.defineProperty(o, k2, desc);
|
|
46
|
+
}) : (function(o, m, k, k2) {
|
|
47
|
+
if (k2 === undefined) k2 = k;
|
|
48
|
+
o[k2] = m[k];
|
|
49
|
+
}));
|
|
50
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
51
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
52
|
+
}) : function(o, v) {
|
|
53
|
+
o["default"] = v;
|
|
54
|
+
});
|
|
55
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
56
|
+
if (mod && mod.__esModule) return mod;
|
|
57
|
+
var result = {};
|
|
58
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
59
|
+
__setModuleDefault(result, mod);
|
|
60
|
+
return result;
|
|
61
|
+
};
|
|
62
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63
|
+
exports.DeepDiffer = exports.DiffChangeType = void 0;
|
|
64
|
+
const _ = __importStar(require("lodash"));
|
|
65
|
+
/**
|
|
66
|
+
* Types of changes that can occur in a deep diff operation
|
|
67
|
+
*/
|
|
68
|
+
var DiffChangeType;
|
|
69
|
+
(function (DiffChangeType) {
|
|
70
|
+
/** A new property or value was added */
|
|
71
|
+
DiffChangeType["Added"] = "added";
|
|
72
|
+
/** An existing property or value was removed */
|
|
73
|
+
DiffChangeType["Removed"] = "removed";
|
|
74
|
+
/** An existing value was changed to a different value */
|
|
75
|
+
DiffChangeType["Modified"] = "modified";
|
|
76
|
+
/** No change detected (only included when includeUnchanged is true) */
|
|
77
|
+
DiffChangeType["Unchanged"] = "unchanged";
|
|
78
|
+
})(DiffChangeType || (exports.DiffChangeType = DiffChangeType = {}));
|
|
79
|
+
/**
|
|
80
|
+
* Deep difference generator for comparing JavaScript objects, arrays, and primitives.
|
|
81
|
+
*
|
|
82
|
+
* This class provides comprehensive comparison capabilities with configurable
|
|
83
|
+
* output formatting and depth control.
|
|
84
|
+
*/
|
|
85
|
+
class DeepDiffer {
|
|
86
|
+
/**
|
|
87
|
+
* Creates a new DeepDiffer instance
|
|
88
|
+
* @param config - Optional configuration overrides
|
|
89
|
+
*/
|
|
90
|
+
constructor(config) {
|
|
91
|
+
this.config = {
|
|
92
|
+
includeUnchanged: false,
|
|
93
|
+
maxDepth: 10,
|
|
94
|
+
maxStringLength: 100,
|
|
95
|
+
includeArrayIndices: true,
|
|
96
|
+
...config
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Generate a deep diff between two values
|
|
101
|
+
*
|
|
102
|
+
* @param oldValue - The original value
|
|
103
|
+
* @param newValue - The new value to compare against
|
|
104
|
+
* @returns Complete diff results including changes, summary, and formatted output
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* const differ = new DeepDiffer({ includeUnchanged: true });
|
|
109
|
+
* const result = differ.diff(
|
|
110
|
+
* { users: [{ id: 1, name: 'Alice' }] },
|
|
111
|
+
* { users: [{ id: 1, name: 'Alice Cooper' }] }
|
|
112
|
+
* );
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
diff(oldValue, newValue) {
|
|
116
|
+
const changes = [];
|
|
117
|
+
// Generate the diff recursively
|
|
118
|
+
this.generateDiff(oldValue, newValue, [], changes, 0);
|
|
119
|
+
// Sort changes by path for consistency
|
|
120
|
+
changes.sort((a, b) => a.path.localeCompare(b.path));
|
|
121
|
+
// Generate summary
|
|
122
|
+
const summary = {
|
|
123
|
+
added: changes.filter(c => c.type === DiffChangeType.Added).length,
|
|
124
|
+
removed: changes.filter(c => c.type === DiffChangeType.Removed).length,
|
|
125
|
+
modified: changes.filter(c => c.type === DiffChangeType.Modified).length,
|
|
126
|
+
unchanged: changes.filter(c => c.type === DiffChangeType.Unchanged).length,
|
|
127
|
+
totalPaths: changes.length
|
|
128
|
+
};
|
|
129
|
+
// Generate formatted output
|
|
130
|
+
const formatted = this.formatDiff(changes, summary);
|
|
131
|
+
return {
|
|
132
|
+
changes,
|
|
133
|
+
summary,
|
|
134
|
+
formatted
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Update configuration options
|
|
139
|
+
* @param config - Partial configuration to merge with existing config
|
|
140
|
+
*/
|
|
141
|
+
updateConfig(config) {
|
|
142
|
+
this.config = { ...this.config, ...config };
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Recursively generate diff between two values
|
|
146
|
+
* @private
|
|
147
|
+
*/
|
|
148
|
+
generateDiff(oldValue, newValue, path, changes, depth) {
|
|
149
|
+
// Check depth limit
|
|
150
|
+
if (depth > this.config.maxDepth) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const pathStr = path.join('.');
|
|
154
|
+
// Handle different cases
|
|
155
|
+
if (oldValue === newValue) {
|
|
156
|
+
if (this.config.includeUnchanged) {
|
|
157
|
+
changes.push({
|
|
158
|
+
path: pathStr || 'root',
|
|
159
|
+
type: DiffChangeType.Unchanged,
|
|
160
|
+
oldValue,
|
|
161
|
+
newValue,
|
|
162
|
+
description: 'No change'
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else if (oldValue === undefined && newValue !== undefined) {
|
|
167
|
+
changes.push({
|
|
168
|
+
path: pathStr || 'root',
|
|
169
|
+
type: DiffChangeType.Added,
|
|
170
|
+
newValue,
|
|
171
|
+
description: this.describeValue(newValue, 'Added')
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
else if (oldValue !== undefined && newValue === undefined) {
|
|
175
|
+
changes.push({
|
|
176
|
+
path: pathStr || 'root',
|
|
177
|
+
type: DiffChangeType.Removed,
|
|
178
|
+
oldValue,
|
|
179
|
+
description: this.describeValue(oldValue, 'Removed')
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
else if (Array.isArray(oldValue) && Array.isArray(newValue)) {
|
|
183
|
+
this.diffArrays(oldValue, newValue, path, changes, depth);
|
|
184
|
+
}
|
|
185
|
+
else if (_.isObject(oldValue) && _.isObject(newValue)) {
|
|
186
|
+
this.diffObjects(oldValue, newValue, path, changes, depth);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
// Values are different types or primitives
|
|
190
|
+
changes.push({
|
|
191
|
+
path: pathStr || 'root',
|
|
192
|
+
type: DiffChangeType.Modified,
|
|
193
|
+
oldValue,
|
|
194
|
+
newValue,
|
|
195
|
+
description: `Changed from ${this.describeValue(oldValue)} to ${this.describeValue(newValue)}`
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Compare two arrays and generate diff
|
|
201
|
+
* @private
|
|
202
|
+
*/
|
|
203
|
+
diffArrays(oldArray, newArray, path, changes, depth) {
|
|
204
|
+
const pathStr = path.join('.');
|
|
205
|
+
// Check if array lengths are different
|
|
206
|
+
if (oldArray.length !== newArray.length) {
|
|
207
|
+
changes.push({
|
|
208
|
+
path: pathStr || 'root',
|
|
209
|
+
type: DiffChangeType.Modified,
|
|
210
|
+
oldValue: `Array[${oldArray.length}]`,
|
|
211
|
+
newValue: `Array[${newArray.length}]`,
|
|
212
|
+
description: `Array length changed from ${oldArray.length} to ${newArray.length}`
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
// Compare array elements
|
|
216
|
+
const maxLength = Math.max(oldArray.length, newArray.length);
|
|
217
|
+
for (let i = 0; i < maxLength; i++) {
|
|
218
|
+
const elementPath = this.config.includeArrayIndices
|
|
219
|
+
? [...path, `[${i}]`]
|
|
220
|
+
: [...path, `[]`];
|
|
221
|
+
if (i < oldArray.length && i < newArray.length) {
|
|
222
|
+
// Element exists in both arrays
|
|
223
|
+
this.generateDiff(oldArray[i], newArray[i], elementPath, changes, depth + 1);
|
|
224
|
+
}
|
|
225
|
+
else if (i < oldArray.length) {
|
|
226
|
+
// Element was removed
|
|
227
|
+
changes.push({
|
|
228
|
+
path: elementPath.join('.'),
|
|
229
|
+
type: DiffChangeType.Removed,
|
|
230
|
+
oldValue: oldArray[i],
|
|
231
|
+
description: this.describeValue(oldArray[i], 'Removed')
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
// Element was added
|
|
236
|
+
changes.push({
|
|
237
|
+
path: elementPath.join('.'),
|
|
238
|
+
type: DiffChangeType.Added,
|
|
239
|
+
newValue: newArray[i],
|
|
240
|
+
description: this.describeValue(newArray[i], 'Added')
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Compare two objects and generate diff
|
|
247
|
+
* @private
|
|
248
|
+
*/
|
|
249
|
+
diffObjects(oldObj, newObj, path, changes, depth) {
|
|
250
|
+
// Get all unique keys from both objects
|
|
251
|
+
const allKeys = new Set([
|
|
252
|
+
...Object.keys(oldObj),
|
|
253
|
+
...Object.keys(newObj)
|
|
254
|
+
]);
|
|
255
|
+
// Compare each key
|
|
256
|
+
for (const key of allKeys) {
|
|
257
|
+
const keyPath = [...path, key];
|
|
258
|
+
this.generateDiff(oldObj[key], newObj[key], keyPath, changes, depth + 1);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Create a human-readable description of a value
|
|
263
|
+
* @private
|
|
264
|
+
*/
|
|
265
|
+
describeValue(value, prefix) {
|
|
266
|
+
if (this.config.valueFormatter) {
|
|
267
|
+
const type = Array.isArray(value) ? 'array' : typeof value;
|
|
268
|
+
return this.config.valueFormatter(value, type);
|
|
269
|
+
}
|
|
270
|
+
const description = this.getValueDescription(value);
|
|
271
|
+
return prefix ? `${prefix} ${description}` : description;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Get a description of a value for display
|
|
275
|
+
* @private
|
|
276
|
+
*/
|
|
277
|
+
getValueDescription(value) {
|
|
278
|
+
if (value === null)
|
|
279
|
+
return 'null';
|
|
280
|
+
if (value === undefined)
|
|
281
|
+
return 'undefined';
|
|
282
|
+
const type = typeof value;
|
|
283
|
+
if (type === 'string') {
|
|
284
|
+
const str = value.length > this.config.maxStringLength
|
|
285
|
+
? `"${value.substring(0, this.config.maxStringLength)}..."`
|
|
286
|
+
: `"${value}"`;
|
|
287
|
+
return str;
|
|
288
|
+
}
|
|
289
|
+
if (type === 'number' || type === 'boolean') {
|
|
290
|
+
return String(value);
|
|
291
|
+
}
|
|
292
|
+
if (Array.isArray(value)) {
|
|
293
|
+
return `Array[${value.length}]`;
|
|
294
|
+
}
|
|
295
|
+
if (_.isObject(value)) {
|
|
296
|
+
const keys = Object.keys(value);
|
|
297
|
+
return `Object{${keys.length} ${keys.length === 1 ? 'key' : 'keys'}}`;
|
|
298
|
+
}
|
|
299
|
+
return String(value);
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Format the diff results as a human-readable string
|
|
303
|
+
* @private
|
|
304
|
+
*/
|
|
305
|
+
formatDiff(changes, summary) {
|
|
306
|
+
const lines = [];
|
|
307
|
+
// Add summary header
|
|
308
|
+
lines.push('=== Deep Diff Summary ===');
|
|
309
|
+
lines.push(`Total changes: ${summary.added + summary.removed + summary.modified}`);
|
|
310
|
+
if (summary.added > 0)
|
|
311
|
+
lines.push(` Added: ${summary.added}`);
|
|
312
|
+
if (summary.removed > 0)
|
|
313
|
+
lines.push(` Removed: ${summary.removed}`);
|
|
314
|
+
if (summary.modified > 0)
|
|
315
|
+
lines.push(` Modified: ${summary.modified}`);
|
|
316
|
+
if (this.config.includeUnchanged && summary.unchanged > 0) {
|
|
317
|
+
lines.push(` Unchanged: ${summary.unchanged}`);
|
|
318
|
+
}
|
|
319
|
+
lines.push('');
|
|
320
|
+
// Add changes
|
|
321
|
+
if (changes.length > 0) {
|
|
322
|
+
lines.push('=== Changes ===');
|
|
323
|
+
// Group changes by type for better readability
|
|
324
|
+
const changesByType = _.groupBy(changes, 'type');
|
|
325
|
+
for (const type of [DiffChangeType.Added, DiffChangeType.Removed, DiffChangeType.Modified]) {
|
|
326
|
+
const typeChanges = changesByType[type];
|
|
327
|
+
if (typeChanges && typeChanges.length > 0) {
|
|
328
|
+
lines.push(`\n${type.charAt(0).toUpperCase() + type.slice(1)}:`);
|
|
329
|
+
for (const change of typeChanges) {
|
|
330
|
+
lines.push(` ${change.path}: ${change.description}`);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (this.config.includeUnchanged && changesByType[DiffChangeType.Unchanged]) {
|
|
335
|
+
lines.push(`\nUnchanged (${changesByType[DiffChangeType.Unchanged].length} items)`);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return lines.join('\n');
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
exports.DeepDiffer = DeepDiffer;
|
|
342
|
+
//# sourceMappingURL=DeepDiff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeepDiff.js","sourceRoot":"","sources":["../src/DeepDiff.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0CAA4B;AAE5B;;GAEG;AACH,IAAY,cASX;AATD,WAAY,cAAc;IACtB,wCAAwC;IACxC,iCAAe,CAAA;IACf,gDAAgD;IAChD,qCAAmB,CAAA;IACnB,yDAAyD;IACzD,uCAAqB,CAAA;IACrB,uEAAuE;IACvE,yCAAuB,CAAA;AAC3B,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB;AAmFD;;;;;GAKG;AACH,MAAa,UAAU;IAGnB;;;OAGG;IACH,YAAY,MAAgC;QACxC,IAAI,CAAC,MAAM,GAAG;YACV,gBAAgB,EAAE,KAAK;YACvB,QAAQ,EAAE,EAAE;YACZ,eAAe,EAAE,GAAG;YACpB,mBAAmB,EAAE,IAAI;YACzB,GAAG,MAAM;SACZ,CAAC;IACN,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACI,IAAI,CAAU,QAAW,EAAE,QAAW;QACzC,MAAM,OAAO,GAAiB,EAAE,CAAC;QAEjC,gCAAgC;QAChC,IAAI,CAAC,YAAY,CACb,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,OAAO,EACP,CAAC,CACJ,CAAC;QAEF,uCAAuC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAErD,mBAAmB;QACnB,MAAM,OAAO,GAAG;YACZ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AC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;CACJ;AAnTD,gCAmTC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './interface';
|
|
|
8
8
|
export * from './util';
|
|
9
9
|
export * from './ObjectCache';
|
|
10
10
|
export * from './BaseSingleton';
|
|
11
|
+
export * from './DeepDiff';
|
|
11
12
|
/**
|
|
12
13
|
* Global class used for coordinating events, creating class instances, and managing components across MemberJunction
|
|
13
14
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AAEjC,OAAO,EAA0B,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAChE,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AAEjC,OAAO,EAA0B,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAA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exportStar(require("./ObjectCache"), exports);
|
|
28
28
|
__exportStar(require("./BaseSingleton"), exports);
|
|
29
|
+
__exportStar(require("./DeepDiff"), exports);
|
|
29
30
|
/**
|
|
30
31
|
* Global class used for coordinating events, creating class instances, and managing components across MemberJunction
|
|
31
32
|
*/
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,+BAA0D;AAC1D,iDAAgE;AAChE,+CAA4C;AAC5C,mDAAgD;AAEhD,+CAAgE;AAAvD,4GAAA,YAAY,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AACxC,8CAA2B;AAC3B,yCAAsB;AACtB,gDAA6B;AAC7B,kDAA+B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,+BAA0D;AAC1D,iDAAgE;AAChE,+CAA4C;AAC5C,mDAAgD;AAEhD,+CAAgE;AAAvD,4GAAA,YAAY,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AACxC,8CAA2B;AAC3B,yCAAsB;AACtB,gDAA6B;AAC7B,kDAA+B;AAC/B,6CAA0B;AAE1B;;GAEG;AACH,MAAa,QAAS,SAAQ,6BAAuB;IAArD;;QACI,8CAA8C;QACtC,mBAAc,GAAwB,IAAI,cAAO,EAAE,CAAC;QACpD,yBAAoB,GAA8B,IAAI,oBAAa,EAAE,CAAC;QAE9E,sDAAsD;QAC9C,aAAQ,GAA2B,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;QACtE,mBAAc,GAA2B,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC;QAElF,gBAAW,GAAsB,EAAE,CAAC;QAEpC,kBAAa,GAAiB,IAAI,2BAAY,EAAE,CAAC;QAEjD,gBAAW,GAA0B,EAAE,CAAC;QA4DxC,iBAAY,GAAgB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