ngx-deep-equals-pure 3.0.0 → 4.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/LICENSE +1 -1
- package/README.md +2 -1
- package/fesm2022/ngx-deep-equals-pure.mjs +4 -4
- package/fesm2022/ngx-deep-equals-pure.mjs.map +1 -1
- package/index.d.ts +14 -5
- package/package.json +3 -3
- package/lib/ngx-deep-equals-pure.module.d.ts +0 -6
- package/lib/ngx-deep-equals-pure.service.d.ts +0 -4
- package/public-api.d.ts +0 -2
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright
|
|
1
|
+
Copyright 2026 Daniel Puckowski
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
package/README.md
CHANGED
|
@@ -9,7 +9,8 @@ Note:
|
|
|
9
9
|
- Version 0.5.0 supports Angular 16.
|
|
10
10
|
- Version 1.0.0 supports Angular 17.
|
|
11
11
|
- Version 2.0.0 supports Angular 18.
|
|
12
|
-
|
|
12
|
+
- Version 3.0.0 supports Angular 19.
|
|
13
|
+
|
|
13
14
|
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
|
|
|
15
16
|
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.
|
|
@@ -179,11 +179,11 @@ class NgxDeepEqualsPureService {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
class NgxDeepEqualsPureModule {
|
|
182
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
183
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
184
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
182
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxDeepEqualsPureModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
183
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: NgxDeepEqualsPureModule }); }
|
|
184
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxDeepEqualsPureModule, providers: [NgxDeepEqualsPureService] }); }
|
|
185
185
|
}
|
|
186
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgxDeepEqualsPureModule, decorators: [{
|
|
187
187
|
type: NgModule,
|
|
188
188
|
args: [{
|
|
189
189
|
declarations: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-deep-equals-pure.mjs","sources":["../../../projects/ngx-deep-equals-pure/src/lib/ngx-deep-equals-pure.service.ts","../../../projects/ngx-deep-equals-pure/src/lib/ngx-deep-equals-pure.module.ts","../../../projects/ngx-deep-equals-pure/src/public-api.ts","../../../projects/ngx-deep-equals-pure/src/ngx-deep-equals-pure.ts"],"sourcesContent":["export class NgxDeepEqualsPureService {\r\n\r\n constructor() { }\r\n\r\n public deepEquals(firstObject: any, secondObject: any): boolean {\r\n if (firstObject === null && secondObject !== null) {\r\n return false;\r\n } else if (secondObject === null && firstObject !== null) {\r\n return false;\r\n } else if (Array.isArray(firstObject) === true) {\r\n if (Array.isArray(secondObject) === false) {\r\n return false;\r\n } else if (firstObject.length !== secondObject.length) {\r\n return false;\r\n } else {\r\n const firstArrays: Set<any> = new Set<any>();\r\n const firstObjects: Set<any> = new Set<any>();\r\n const firstValues: Set<any> = new Set<any>();\r\n const firstFunctions: Set<any> = new Set<any>();\r\n\r\n for (const value of firstObject) {\r\n if (Array.isArray(value) === true) {\r\n firstArrays.add(value);\r\n } else if (typeof value === 'object') {\r\n firstObjects.add(value);\r\n } else if (typeof value === 'function') {\r\n firstFunctions.add(JSON.stringify('' + value));\r\n } else {\r\n firstValues.add(value);\r\n }\r\n }\r\n\r\n const secondArrays: Set<any> = new Set<any>();\r\n const secondObjects: Set<any> = new Set<any>();\r\n const secondValues: Set<any> = new Set<any>();\r\n const secondFunctions: Set<any> = new Set<any>();\r\n\r\n for (const value of secondObject) {\r\n if (Array.isArray(value) === true) {\r\n secondArrays.add(value);\r\n } else if (typeof value === 'object') {\r\n secondObjects.add(value);\r\n } else if (typeof value === 'function') {\r\n secondFunctions.add(JSON.stringify('' + value));\r\n } else {\r\n secondValues.add(value);\r\n }\r\n }\r\n\r\n if (firstValues.size !== secondValues.size) {\r\n return false;\r\n } else {\r\n let match = true;\r\n for (const value of firstValues) {\r\n if (secondValues.has(value) === false) {\r\n match = false;\r\n break;\r\n }\r\n }\r\n\r\n if (match === false) {\r\n return false;\r\n } else if (firstObjects.size === secondObjects.size) {\r\n match = true;\r\n for (const value of firstObjects) {\r\n let hasMatch = false;\r\n for (const secondValue of secondObjects) {\r\n if (this.deepEquals(value, secondValue) === true) {\r\n hasMatch = true;\r\n break;\r\n }\r\n }\r\n\r\n if (hasMatch === false) {\r\n match = false;\r\n break;\r\n }\r\n }\r\n\r\n if (match === false) {\r\n return false;\r\n } else if (firstArrays.size === secondArrays.size) {\r\n match = true;\r\n for (const value of firstArrays) {\r\n let hasMatch = false;\r\n for (const secondValue of secondArrays) {\r\n if (this.deepEquals(value, secondValue) === true) {\r\n hasMatch = true;\r\n break;\r\n }\r\n }\r\n\r\n if (hasMatch === false) {\r\n match = false;\r\n break;\r\n }\r\n }\r\n\r\n if (match === false) {\r\n return false;\r\n } else if (firstFunctions.size === secondFunctions.size) {\r\n match = true;\r\n for (const value of firstFunctions) {\r\n if (secondFunctions.has(value) === false) {\r\n match = false;\r\n break;\r\n }\r\n }\r\n\r\n if (match === false) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n } else if (typeof firstObject === 'object' && firstObject !== null) {\r\n if (typeof secondObject !== 'object') {\r\n return false;\r\n } else {\r\n let match = true;\r\n\r\n if (Object.keys(firstObject).length === Object.keys(secondObject).length) {\r\n for (const [key, value] of Object.entries(firstObject)) {\r\n const secondValue = secondObject[key];\r\n\r\n match = this.deepEquals(value, secondValue);\r\n\r\n if (match === false) {\r\n break;\r\n }\r\n }\r\n } else {\r\n match = false;\r\n }\r\n\r\n return match;\r\n }\r\n } else {\r\n if (Array.isArray(secondObject) === true) {\r\n return false;\r\n } else if (typeof secondObject === 'object' && secondObject !== null) {\r\n return false;\r\n } else {\r\n if (typeof firstObject === 'function') {\r\n if (typeof secondObject === 'function') {\r\n return JSON.stringify('' + firstObject) === JSON.stringify('' + secondObject);\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return JSON.stringify(firstObject) === JSON.stringify(secondObject);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { NgxDeepEqualsPureService } from './ngx-deep-equals-pure.service';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [],\r\n exports: [],\r\n providers: [NgxDeepEqualsPureService]\r\n})\r\nexport class NgxDeepEqualsPureModule { }\r\n","/*\r\n * Public API Surface of ngx-deep-equals-pure\r\n */\r\n\r\nexport * from './lib/ngx-deep-equals-pure.service';\r\nexport * from './lib/ngx-deep-equals-pure.module';\r\n","/**\n *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IAAI,EAAE;AACxC,gBAAA,OAAO,KAAK,CAAC;aACd;iBAAM,IAAI,OAAO,YAAY,KAAK,QAAQ,IAAI,YAAY,KAAK,IAAI,EAAE;AACpE,gBAAA,OAAO,KAAK,CAAC;aACd;iBAAM;AACL,gBAAA,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;AACrC,oBAAA,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE;AACtC,wBAAA,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,WAAW,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,YAAY,CAAC,CAAC;qBAC/E;yBAAM;AACL,wBAAA,OAAO,KAAK,CAAC;qBACd;iBACF;qBAAM;AACL,oBAAA,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;iBACrE;aACF;SACF;KACF;AACF;;MC5JY,uBAAuB,CAAA;qHAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;sHAAvB,uBAAuB,EAAA,CAAA,CAAA,EAAA;sHAAvB,uBAAuB,EAAA,SAAA,EAFvB,CAAC,wBAAwB,CAAC,EAAA,CAAA,CAAA,EAAA;;kGAE1B,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBANnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,EAAE;oBACX,SAAS,EAAE,CAAC,wBAAwB,CAAC;AACtC,iBAAA,CAAA;;;ACRD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-deep-equals-pure.mjs","sources":["../../../projects/ngx-deep-equals-pure/src/lib/ngx-deep-equals-pure.service.ts","../../../projects/ngx-deep-equals-pure/src/lib/ngx-deep-equals-pure.module.ts","../../../projects/ngx-deep-equals-pure/src/public-api.ts","../../../projects/ngx-deep-equals-pure/src/ngx-deep-equals-pure.ts"],"sourcesContent":["export class NgxDeepEqualsPureService {\r\n\r\n constructor() { }\r\n\r\n public deepEquals(firstObject: any, secondObject: any): boolean {\r\n if (firstObject === null && secondObject !== null) {\r\n return false;\r\n } else if (secondObject === null && firstObject !== null) {\r\n return false;\r\n } else if (Array.isArray(firstObject) === true) {\r\n if (Array.isArray(secondObject) === false) {\r\n return false;\r\n } else if (firstObject.length !== secondObject.length) {\r\n return false;\r\n } else {\r\n const firstArrays: Set<any> = new Set<any>();\r\n const firstObjects: Set<any> = new Set<any>();\r\n const firstValues: Set<any> = new Set<any>();\r\n const firstFunctions: Set<any> = new Set<any>();\r\n\r\n for (const value of firstObject) {\r\n if (Array.isArray(value) === true) {\r\n firstArrays.add(value);\r\n } else if (typeof value === 'object') {\r\n firstObjects.add(value);\r\n } else if (typeof value === 'function') {\r\n firstFunctions.add(JSON.stringify('' + value));\r\n } else {\r\n firstValues.add(value);\r\n }\r\n }\r\n\r\n const secondArrays: Set<any> = new Set<any>();\r\n const secondObjects: Set<any> = new Set<any>();\r\n const secondValues: Set<any> = new Set<any>();\r\n const secondFunctions: Set<any> = new Set<any>();\r\n\r\n for (const value of secondObject) {\r\n if (Array.isArray(value) === true) {\r\n secondArrays.add(value);\r\n } else if (typeof value === 'object') {\r\n secondObjects.add(value);\r\n } else if (typeof value === 'function') {\r\n secondFunctions.add(JSON.stringify('' + value));\r\n } else {\r\n secondValues.add(value);\r\n }\r\n }\r\n\r\n if (firstValues.size !== secondValues.size) {\r\n return false;\r\n } else {\r\n let match = true;\r\n for (const value of firstValues) {\r\n if (secondValues.has(value) === false) {\r\n match = false;\r\n break;\r\n }\r\n }\r\n\r\n if (match === false) {\r\n return false;\r\n } else if (firstObjects.size === secondObjects.size) {\r\n match = true;\r\n for (const value of firstObjects) {\r\n let hasMatch = false;\r\n for (const secondValue of secondObjects) {\r\n if (this.deepEquals(value, secondValue) === true) {\r\n hasMatch = true;\r\n break;\r\n }\r\n }\r\n\r\n if (hasMatch === false) {\r\n match = false;\r\n break;\r\n }\r\n }\r\n\r\n if (match === false) {\r\n return false;\r\n } else if (firstArrays.size === secondArrays.size) {\r\n match = true;\r\n for (const value of firstArrays) {\r\n let hasMatch = false;\r\n for (const secondValue of secondArrays) {\r\n if (this.deepEquals(value, secondValue) === true) {\r\n hasMatch = true;\r\n break;\r\n }\r\n }\r\n\r\n if (hasMatch === false) {\r\n match = false;\r\n break;\r\n }\r\n }\r\n\r\n if (match === false) {\r\n return false;\r\n } else if (firstFunctions.size === secondFunctions.size) {\r\n match = true;\r\n for (const value of firstFunctions) {\r\n if (secondFunctions.has(value) === false) {\r\n match = false;\r\n break;\r\n }\r\n }\r\n\r\n if (match === false) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n } else if (typeof firstObject === 'object' && firstObject !== null) {\r\n if (typeof secondObject !== 'object') {\r\n return false;\r\n } else {\r\n let match = true;\r\n\r\n if (Object.keys(firstObject).length === Object.keys(secondObject).length) {\r\n for (const [key, value] of Object.entries(firstObject)) {\r\n const secondValue = secondObject[key];\r\n\r\n match = this.deepEquals(value, secondValue);\r\n\r\n if (match === false) {\r\n break;\r\n }\r\n }\r\n } else {\r\n match = false;\r\n }\r\n\r\n return match;\r\n }\r\n } else {\r\n if (Array.isArray(secondObject) === true) {\r\n return false;\r\n } else if (typeof secondObject === 'object' && secondObject !== null) {\r\n return false;\r\n } else {\r\n if (typeof firstObject === 'function') {\r\n if (typeof secondObject === 'function') {\r\n return JSON.stringify('' + firstObject) === JSON.stringify('' + secondObject);\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return JSON.stringify(firstObject) === JSON.stringify(secondObject);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { NgxDeepEqualsPureService } from './ngx-deep-equals-pure.service';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [],\r\n exports: [],\r\n providers: [NgxDeepEqualsPureService]\r\n})\r\nexport class NgxDeepEqualsPureModule { }\r\n","/*\r\n * Public API Surface of ngx-deep-equals-pure\r\n */\r\n\r\nexport * from './lib/ngx-deep-equals-pure.service';\r\nexport * from './lib/ngx-deep-equals-pure.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAAa,wBAAwB,CAAA;AAEnC,IAAA,WAAA,GAAA,EAAgB;IAET,UAAU,CAAC,WAAgB,EAAE,YAAiB,EAAA;QACnD,IAAI,WAAW,KAAK,IAAI,IAAI,YAAY,KAAK,IAAI,EAAE;AACjD,YAAA,OAAO,KAAK;QACd;aAAO,IAAI,YAAY,KAAK,IAAI,IAAI,WAAW,KAAK,IAAI,EAAE;AACxD,YAAA,OAAO,KAAK;QACd;aAAO,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE;YAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,KAAK,EAAE;AACzC,gBAAA,OAAO,KAAK;YACd;iBAAO,IAAI,WAAW,CAAC,MAAM,KAAK,YAAY,CAAC,MAAM,EAAE;AACrD,gBAAA,OAAO,KAAK;YACd;iBAAO;AACL,gBAAA,MAAM,WAAW,GAAa,IAAI,GAAG,EAAO;AAC5C,gBAAA,MAAM,YAAY,GAAa,IAAI,GAAG,EAAO;AAC7C,gBAAA,MAAM,WAAW,GAAa,IAAI,GAAG,EAAO;AAC5C,gBAAA,MAAM,cAAc,GAAa,IAAI,GAAG,EAAO;AAE/C,gBAAA,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE;oBAC/B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE;AACjC,wBAAA,WAAW,CAAC,GAA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
+
deepEquals(firstObject: any, secondObject: any): boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare class NgxDeepEqualsPureModule {
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxDeepEqualsPureModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxDeepEqualsPureModule, never, never, never>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxDeepEqualsPureModule>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { NgxDeepEqualsPureModule, NgxDeepEqualsPureService };
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-deep-equals-pure",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": ">=
|
|
6
|
-
"@angular/core": ">=
|
|
5
|
+
"@angular/common": ">=20.0.0 || >=20.0.0-next.0",
|
|
6
|
+
"@angular/core": ">=20.0.0 || >=20.0.0-next.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"tslib": ">=2.3.0"
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class NgxDeepEqualsPureModule {
|
|
3
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgxDeepEqualsPureModule, never>;
|
|
4
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxDeepEqualsPureModule, never, never, never>;
|
|
5
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<NgxDeepEqualsPureModule>;
|
|
6
|
-
}
|
package/public-api.d.ts
DELETED