ngx-deep-equals-pure 1.0.0 → 2.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/README.md +321 -320
- package/esm2022/lib/ngx-deep-equals-pure.module.mjs +18 -18
- package/esm2022/lib/ngx-deep-equals-pure.service.mjs +177 -177
- package/esm2022/ngx-deep-equals-pure.mjs +4 -4
- package/esm2022/public-api.mjs +6 -6
- package/fesm2022/ngx-deep-equals-pure.mjs +179 -203
- package/fesm2022/ngx-deep-equals-pure.mjs.map +7 -1
- package/index.d.ts +5 -5
- package/lib/ngx-deep-equals-pure.module.d.ts +6 -6
- package/lib/ngx-deep-equals-pure.service.d.ts +4 -4
- package/package.json +3 -3
- package/public-api.d.ts +2 -2
package/README.md
CHANGED
|
@@ -1,320 +1,321 @@
|
|
|
1
|
-
# NgxDeepEqualsPure
|
|
2
|
-
|
|
3
|
-
Note:
|
|
4
|
-
- Please use version 0.2.5 for projects using Angular 11.0 and below.
|
|
5
|
-
- Please use version 0.3.0+ for Angular 12.0+ projects.
|
|
6
|
-
- Version 0.4.0+ supports use in Web Workers (see example project in this repository).
|
|
7
|
-
- Version 0.4.2 is malformed and should not be used.
|
|
8
|
-
- Version 0.4.3+ supports Standalone Components.
|
|
9
|
-
- Version 0.5.0 supports Angular 16.
|
|
10
|
-
- Version 1.0.0 supports Angular 17.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
import {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
private
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
| 0.
|
|
88
|
-
| 0.
|
|
89
|
-
| 0.006 | 0.
|
|
90
|
-
| 0.006 | 0.001 | 0.115 |
|
|
91
|
-
| 0.006 | 0.001 | 0.
|
|
92
|
-
| 0.
|
|
93
|
-
| 0.
|
|
94
|
-
| 0.006 | 0.001 | 0.
|
|
95
|
-
| 0.006 | 0.001 | 0.
|
|
96
|
-
| 0.006 | 0.001 | 0.117 |
|
|
97
|
-
| 0.006 | 0.001 | 0.
|
|
98
|
-
| 0.006 | 0.001 | 0.
|
|
99
|
-
| 0.006 | 0.001 | 0.118 |
|
|
100
|
-
| 0.006 | 0.001 | 0.118 |
|
|
101
|
-
| 0.
|
|
102
|
-
| 0.
|
|
103
|
-
| 0.006 | 0.001 | 0.
|
|
104
|
-
| 0.006 | 0
|
|
105
|
-
| 0.006 | 0
|
|
106
|
-
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
this.isMatch.push(this.deep.deepEquals(obj1,
|
|
112
|
-
this.isMatch.push(this.deep.deepEquals(obj1,
|
|
113
|
-
this.isMatch.push(this.deep.deepEquals(obj1,
|
|
114
|
-
this.isMatch.push(this.deep.deepEquals(obj1,
|
|
115
|
-
this.isMatch.push(this.deep.deepEquals(obj1,
|
|
116
|
-
this.isMatch.push(this.deep.deepEquals(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
this.isMatchLodash.push(_.isEqual(obj1,
|
|
120
|
-
this.isMatchLodash.push(_.isEqual(obj1,
|
|
121
|
-
this.isMatchLodash.push(_.isEqual(obj1,
|
|
122
|
-
this.isMatchLodash.push(_.isEqual(obj1,
|
|
123
|
-
this.isMatchLodash.push(_.isEqual(obj1,
|
|
124
|
-
this.isMatchLodash.push(_.isEqual(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
this.isMatchDeepEqual.push(deepEqual(obj1,
|
|
128
|
-
this.isMatchDeepEqual.push(deepEqual(obj1,
|
|
129
|
-
this.isMatchDeepEqual.push(deepEqual(obj1,
|
|
130
|
-
this.isMatchDeepEqual.push(deepEqual(obj1,
|
|
131
|
-
this.isMatchDeepEqual.push(deepEqual(obj1,
|
|
132
|
-
this.isMatchDeepEqual.push(deepEqual(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
{ '
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
'
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
'
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
{ '
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
'
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
{ '
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
'
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
{ '
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
'
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
{ '
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
'
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
{ '
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
{ '
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
'
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
1
|
+
# NgxDeepEqualsPure
|
|
2
|
+
|
|
3
|
+
Note:
|
|
4
|
+
- Please use version 0.2.5 for projects using Angular 11.0 and below.
|
|
5
|
+
- Please use version 0.3.0+ for Angular 12.0+ projects.
|
|
6
|
+
- Version 0.4.0+ supports use in Web Workers (see example project in this repository).
|
|
7
|
+
- Version 0.4.2 is malformed and should not be used.
|
|
8
|
+
- Version 0.4.3+ supports Standalone Components.
|
|
9
|
+
- Version 0.5.0 supports Angular 16.
|
|
10
|
+
- Version 1.0.0 supports Angular 17.
|
|
11
|
+
- Version 2.0.0 supports Angular 18.
|
|
12
|
+
|
|
13
|
+
This is a package intended to provide a deep equals function for JavaScript objects without requiring numerous dependencies. Other packages which provide a deep equals function, like Lodash or deep-equal, require a large number of dependencies or they are themselves very large. This contributes to unnecessary bloat and, ultimately, poor application load performance.
|
|
14
|
+
|
|
15
|
+
Unlike deep-equal and Lodash, ngx-deep-equals-pure can correctly handle function properties. Furthermore, ngx-deep-equals-pure properly determines equality for arrays of complex objects when the order of the data differs where deep-equal and Lodash fail to do so.
|
|
16
|
+
|
|
17
|
+
Repository:
|
|
18
|
+
https://github.com/puckowski/deepequalspure
|
|
19
|
+
|
|
20
|
+
Bugs:
|
|
21
|
+
https://github.com/puckowski/deepequalspure/issues
|
|
22
|
+
|
|
23
|
+
## Size
|
|
24
|
+
|
|
25
|
+
The minified ES2015 size of ngx-deep-equals-pure is 9.18KB which includes ESM5, ESM2015, FESM5, and FESM2015 bundles.
|
|
26
|
+
|
|
27
|
+
|ngx-deep-equals-pure |deep-equal |Lodash |
|
|
28
|
+
|---------------------|-----------|-------|
|
|
29
|
+
|9.18KB |3.44KB |528KB |
|
|
30
|
+
|
|
31
|
+
## npm Package
|
|
32
|
+
|
|
33
|
+
https://www.npmjs.com/package/ngx-deep-equals-pure
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
In the appropriate module, such as ```AppModule```, add the following to ```providers```:
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
providers: [NgxDeepEqualsPureService],
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
In a component part of a module where NgxDeepEqualsPureService is provided, inject the deep equals service in the constructor like so:
|
|
44
|
+
|
|
45
|
+
```javascript
|
|
46
|
+
constructor(private ngxDeepEquals: NgxDeepEqualsPureService) {
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Then use NgxDeepEqualsPure like so:
|
|
50
|
+
|
|
51
|
+
```javascript
|
|
52
|
+
this.ngxDeepEquals.deepEquals(this.obj1, this.obj2);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Alternatively, construct a standalone component like the following:
|
|
56
|
+
|
|
57
|
+
```javascript
|
|
58
|
+
import { Component } from '@angular/core';
|
|
59
|
+
import { NgxDeepEqualsPureModule, NgxDeepEqualsPureService } from 'NgxDeepEqualsPure';
|
|
60
|
+
|
|
61
|
+
@Component({
|
|
62
|
+
selector: 'app-standalone-test',
|
|
63
|
+
templateUrl: './standalone-test.component.html',
|
|
64
|
+
styleUrls: ['./standalone-test.component.scss'],
|
|
65
|
+
standalone: true,
|
|
66
|
+
imports: [NgxDeepEqualsPureModule]
|
|
67
|
+
})
|
|
68
|
+
export class StandaloneTestComponent {
|
|
69
|
+
|
|
70
|
+
private obj8: any = { b: 'a', c: 2 };
|
|
71
|
+
private obj9: any = { c: 2, b: 'a' };
|
|
72
|
+
|
|
73
|
+
public isStandaloneMatch: boolean;
|
|
74
|
+
|
|
75
|
+
constructor(private ngxDeepEquals: NgxDeepEqualsPureService) {
|
|
76
|
+
this.isStandaloneMatch = this.ngxDeepEquals.deepEquals(this.obj8, this.obj9);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Performance
|
|
82
|
+
|
|
83
|
+
The following is the latest performance result of 2,000 comparisons run in a web worker.
|
|
84
|
+
|
|
85
|
+
|ngx-deep-equals-pure |deep-equal |Lodash isEqual |
|
|
86
|
+
|---------------------|-----------|---------------|
|
|
87
|
+
| 0.023 | 0.006 | 0.091 |
|
|
88
|
+
| 0.007 | 0.008 | 0.107 |
|
|
89
|
+
| 0.006 | 0.004 | 0.106 |
|
|
90
|
+
| 0.006 | 0.001 | 0.115 |
|
|
91
|
+
| 0.006 | 0.001 | 0.115 |
|
|
92
|
+
| 0.006 | 0.001 | 0.117 |
|
|
93
|
+
| 0.005 | 0.001 | 0.117 |
|
|
94
|
+
| 0.006 | 0.001 | 0.12 |
|
|
95
|
+
| 0.006 | 0.001 | 0.118 |
|
|
96
|
+
| 0.006 | 0.001 | 0.117 |
|
|
97
|
+
| 0.006 | 0.001 | 0.117 |
|
|
98
|
+
| 0.006 | 0.001 | 0.116 |
|
|
99
|
+
| 0.006 | 0.001 | 0.118 |
|
|
100
|
+
| 0.006 | 0.001 | 0.118 |
|
|
101
|
+
| 0.006 | 0.001 | 0.118 |
|
|
102
|
+
| 0.005 | 0.001 | 0.118 |
|
|
103
|
+
| 0.006 | 0.001 | 0.119 |
|
|
104
|
+
| 0.006 | 0.001 | 0.118 |
|
|
105
|
+
| 0.006 | 0 | 0.118 |
|
|
106
|
+
| 0.006 | 0.002 | 0.117 |
|
|
107
|
+
| **Avg: 0.0068s** | **Avg: 0.00175s** | **Avg: 0.1149s** |
|
|
108
|
+
|
|
109
|
+
## Tests
|
|
110
|
+
```javascript
|
|
111
|
+
this.isMatch.push(this.deep.deepEquals(obj1, obj2));
|
|
112
|
+
this.isMatch.push(this.deep.deepEquals(obj1, obj3));
|
|
113
|
+
this.isMatch.push(this.deep.deepEquals(obj1, obj4));
|
|
114
|
+
this.isMatch.push(this.deep.deepEquals(obj1, obj5));
|
|
115
|
+
this.isMatch.push(this.deep.deepEquals(obj1, obj6));
|
|
116
|
+
this.isMatch.push(this.deep.deepEquals(obj1, obj7));
|
|
117
|
+
this.isMatch.push(this.deep.deepEquals(obj8, obj9));
|
|
118
|
+
|
|
119
|
+
this.isMatchLodash.push(_.isEqual(obj1, obj2));
|
|
120
|
+
this.isMatchLodash.push(_.isEqual(obj1, obj3));
|
|
121
|
+
this.isMatchLodash.push(_.isEqual(obj1, obj4));
|
|
122
|
+
this.isMatchLodash.push(_.isEqual(obj1, obj5));
|
|
123
|
+
this.isMatchLodash.push(_.isEqual(obj1, obj6));
|
|
124
|
+
this.isMatchLodash.push(_.isEqual(obj1, obj7));
|
|
125
|
+
this.isMatchLodash.push(_.isEqual(obj8, obj9));
|
|
126
|
+
|
|
127
|
+
this.isMatchDeepEqual.push(deepEqual(obj1, obj2));
|
|
128
|
+
this.isMatchDeepEqual.push(deepEqual(obj1, obj3));
|
|
129
|
+
this.isMatchDeepEqual.push(deepEqual(obj1, obj4));
|
|
130
|
+
this.isMatchDeepEqual.push(deepEqual(obj1, obj5));
|
|
131
|
+
this.isMatchDeepEqual.push(deepEqual(obj1, obj6));
|
|
132
|
+
this.isMatchDeepEqual.push(deepEqual(obj1, obj7));
|
|
133
|
+
this.isMatchDeepEqual.push(deepEqual(obj8, obj9));
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Results
|
|
137
|
+
|#|Actual |ngx-deep-equals-pure |deep-equal |Lodash isEqual |
|
|
138
|
+
|---|-------------|---------------------|-----------|---------------|
|
|
139
|
+
|1 | true | true | false | false |
|
|
140
|
+
|2 | false | false | false | false |
|
|
141
|
+
|3 | false | false | false | false |
|
|
142
|
+
|4 | false | false | false | false |
|
|
143
|
+
|5 | false | false | false | false |
|
|
144
|
+
|6 | true | true | false | false |
|
|
145
|
+
|7 | true | true | true | true |
|
|
146
|
+
|
|
147
|
+
## Input objects
|
|
148
|
+
```javascript
|
|
149
|
+
const obj1: any = {
|
|
150
|
+
b: () => {
|
|
151
|
+
console.log('foo');
|
|
152
|
+
},
|
|
153
|
+
e: 'abcbc',
|
|
154
|
+
a: [
|
|
155
|
+
{ 'a': 12.7 },
|
|
156
|
+
{ 'c': 37.6 }
|
|
157
|
+
],
|
|
158
|
+
c: 126.8,
|
|
159
|
+
f: ['f', 'a'],
|
|
160
|
+
g: [
|
|
161
|
+
{ t: () => { console.log('h'); }, g: 'a', j: 12 },
|
|
162
|
+
['b', 2, { p: '123' }],
|
|
163
|
+
'789',
|
|
164
|
+
12.6,
|
|
165
|
+
809,
|
|
166
|
+
() => { console.log('er'); }
|
|
167
|
+
]
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const obj2: any = {
|
|
171
|
+
g: [
|
|
172
|
+
[{ p: '123' }, 2, 'b'],
|
|
173
|
+
'789',
|
|
174
|
+
12.6,
|
|
175
|
+
() => { console.log('er'); },
|
|
176
|
+
{ g: 'a', t: () => { console.log('h'); }, j: 12 },
|
|
177
|
+
809
|
|
178
|
+
],
|
|
179
|
+
e: 'abcbc',
|
|
180
|
+
b: () => {
|
|
181
|
+
console.log('foo');
|
|
182
|
+
},
|
|
183
|
+
a: [
|
|
184
|
+
{ 'c': 37.6 },
|
|
185
|
+
{ 'a': 12.7 }
|
|
186
|
+
],
|
|
187
|
+
f: ['f', 'a'],
|
|
188
|
+
c: 126.8
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
const obj3: any = {
|
|
192
|
+
g: [
|
|
193
|
+
[{ p: '123' }, 2, 'b'],
|
|
194
|
+
'789',
|
|
195
|
+
12.6,
|
|
196
|
+
() => { console.log('er'); },
|
|
197
|
+
{ t: () => { console.log('h'); }, j: 12 },
|
|
198
|
+
809
|
|
199
|
+
],
|
|
200
|
+
e: 'abcbc',
|
|
201
|
+
b: () => {
|
|
202
|
+
console.log('foo');
|
|
203
|
+
},
|
|
204
|
+
a: [
|
|
205
|
+
{ 'c': 37.6 },
|
|
206
|
+
{ 'a': 12.7 }
|
|
207
|
+
],
|
|
208
|
+
f: ['f', 'a'],
|
|
209
|
+
c: 126.8
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const obj4: any = {
|
|
213
|
+
g: [
|
|
214
|
+
[{ p: '123' }, 2, 'b'],
|
|
215
|
+
'789',
|
|
216
|
+
12.6,
|
|
217
|
+
() => { console.log('er'); },
|
|
218
|
+
{ g: '6', t: () => { console.log('h'); }, j: 12 },
|
|
219
|
+
809
|
|
220
|
+
],
|
|
221
|
+
e: 'abcbc',
|
|
222
|
+
b: () => {
|
|
223
|
+
console.log('foo');
|
|
224
|
+
},
|
|
225
|
+
a: [
|
|
226
|
+
{ 'c': 37.6 },
|
|
227
|
+
{ 'a': 12.7 }
|
|
228
|
+
],
|
|
229
|
+
f: ['f', 'a'],
|
|
230
|
+
c: 126.8
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
const obj5: any = {
|
|
234
|
+
g: [
|
|
235
|
+
[{ u: '123' }, 2, 'b'],
|
|
236
|
+
'789',
|
|
237
|
+
12.6,
|
|
238
|
+
() => { console.log('er'); },
|
|
239
|
+
{ g: 'a', t: () => { console.log('h'); }, j: 12 },
|
|
240
|
+
809
|
|
241
|
+
],
|
|
242
|
+
e: 'abcbc',
|
|
243
|
+
b: () => {
|
|
244
|
+
console.log('foo');
|
|
245
|
+
},
|
|
246
|
+
a: [
|
|
247
|
+
{ 'c': 37.6 },
|
|
248
|
+
{ 'a': 12.7 }
|
|
249
|
+
],
|
|
250
|
+
f: ['f', 'a'],
|
|
251
|
+
c: 126.8
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
const obj6: any = {
|
|
255
|
+
g: [
|
|
256
|
+
[{ p: '123' }, 2, 'b'],
|
|
257
|
+
'789',
|
|
258
|
+
12.6,
|
|
259
|
+
() => { console.log('er'); },
|
|
260
|
+
{ g: 'a', y: () => { console.log('h'); }, j: 12 },
|
|
261
|
+
809
|
|
262
|
+
],
|
|
263
|
+
e: 'abcbc',
|
|
264
|
+
b: () => {
|
|
265
|
+
console.log('foo');
|
|
266
|
+
},
|
|
267
|
+
a: [
|
|
268
|
+
{ 'c': 37.6 },
|
|
269
|
+
{ 'a': 12.7 }
|
|
270
|
+
],
|
|
271
|
+
f: ['f', 'a'],
|
|
272
|
+
c: 126.8
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
const obj7: any = {
|
|
276
|
+
b: () => {
|
|
277
|
+
console.log('foo');
|
|
278
|
+
},
|
|
279
|
+
e: 'abcbc',
|
|
280
|
+
a: [
|
|
281
|
+
{ 'a': 12.7 },
|
|
282
|
+
{ 'c': 37.6 }
|
|
283
|
+
],
|
|
284
|
+
c: 126.8,
|
|
285
|
+
f: ['f', 'a'],
|
|
286
|
+
g: [
|
|
287
|
+
{ t: () => { console.log('h'); }, g: 'a', j: 12 },
|
|
288
|
+
['b', 2, { p: '123' }],
|
|
289
|
+
'789',
|
|
290
|
+
12.6,
|
|
291
|
+
809,
|
|
292
|
+
() => { console.log('er'); }
|
|
293
|
+
]
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
const obj8: any = { b: 'a', c: 2 };
|
|
297
|
+
const obj9: any = { c: 2, b: 'a' };
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## Building library
|
|
301
|
+
|
|
302
|
+
Use command:
|
|
303
|
+
|
|
304
|
+
```
|
|
305
|
+
ng build NgxDeepEqualsPure --configuration production
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## Running benchmark
|
|
309
|
+
|
|
310
|
+
Use command:
|
|
311
|
+
|
|
312
|
+
```
|
|
313
|
+
ng serve
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Then navigate to localhost:4200 in your preferred browser.
|
|
317
|
+
|
|
318
|
+
Note:
|
|
319
|
+
It may be necessary to run the build command before trying to run the benchmark.
|
|
320
|
+
|
|
321
|
+
See the GitHub repository at https://github.com/puckowski/deepequalspure for example usage of ngx-deep-equals-pure in an Angular application and for example usage in a Web Worker.
|