@nu-art/ts-common 0.203.19 → 0.203.20
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/package.json +1 -1
- package/utils/object-tools.d.ts +3 -0
- package/utils/object-tools.js +3 -0
package/package.json
CHANGED
package/utils/object-tools.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ export declare function _setTypedProp<T extends TS_Object>(instance: T, key: key
|
|
|
8
8
|
export declare function cloneArr<T>(value: T[]): T[];
|
|
9
9
|
export declare function cloneObj<T extends TS_Object>(obj: T): T;
|
|
10
10
|
export declare function partialCompare<T extends any>(one?: T, two?: T, keysToFilterOut?: (keyof T)[]): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Returns true for equal.
|
|
13
|
+
*/
|
|
11
14
|
export declare function compare<T extends any>(one?: T, two?: T, keys?: (keyof T)[]): boolean;
|
|
12
15
|
export declare function assert<T>(message: string, expected: T, actual: T): void;
|
|
13
16
|
export declare function filterKeys<T extends TS_Object = TS_Object>(obj: T, keys?: keyof T | (keyof T)[], filter?: (k: keyof T, obj: T) => boolean): T;
|
package/utils/object-tools.js
CHANGED
|
@@ -61,6 +61,9 @@ function partialCompare(one, two, keysToFilterOut) {
|
|
|
61
61
|
return compare(one, two);
|
|
62
62
|
}
|
|
63
63
|
exports.partialCompare = partialCompare;
|
|
64
|
+
/**
|
|
65
|
+
* Returns true for equal.
|
|
66
|
+
*/
|
|
64
67
|
function compare(one, two, keys) {
|
|
65
68
|
const typeofOne = typeof one;
|
|
66
69
|
const typeofTwo = typeof two;
|