@ztimson/utils 0.26.24 → 0.26.26
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/index.cjs +41 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +41 -0
- package/dist/index.mjs.map +1 -1
- package/dist/objects.d.ts +17 -0
- package/package.json +1 -1
package/dist/objects.d.ts
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
export type Delta = {
|
|
2
|
+
[key: string]: any | Delta | null;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Applies deltas in order to modify `target`.
|
|
6
|
+
* @param target - Object to mutate
|
|
7
|
+
* @param deltas - List of deltas to apply
|
|
8
|
+
* @returns Mutated target
|
|
9
|
+
*/
|
|
10
|
+
export declare function applyDeltas(target: any, deltas: Delta[]): any;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a nested delta that reverts `target` back to `old`.
|
|
13
|
+
* @param old - Original object
|
|
14
|
+
* @param target - Modified object
|
|
15
|
+
* @returns Delta to revert changes
|
|
16
|
+
*/
|
|
17
|
+
export declare function calcDelta(old: any, target: any): Delta;
|
|
1
18
|
/**
|
|
2
19
|
* Removes any null values from an object in-place
|
|
3
20
|
*
|