@domql/utils 2.2.1 → 2.2.8
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/object.js +18 -0
- package/package.json +2 -2
package/object.js
CHANGED
|
@@ -153,6 +153,24 @@ export const diff = (obj, original, cache) => {
|
|
|
153
153
|
return changes
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Overwrites object properties with another
|
|
158
|
+
*/
|
|
159
|
+
export const overwriteObj = (params, obj) => {
|
|
160
|
+
const changes = {}
|
|
161
|
+
|
|
162
|
+
for (const e in params) {
|
|
163
|
+
const objProp = obj[e]
|
|
164
|
+
const paramsProp = params[e]
|
|
165
|
+
|
|
166
|
+
if (paramsProp) {
|
|
167
|
+
obj[e] = changes[e] = objProp
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return changes
|
|
172
|
+
}
|
|
173
|
+
|
|
156
174
|
/**
|
|
157
175
|
* Overwrites DEEPly object properties with another
|
|
158
176
|
*/
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/utils",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.8",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@domql/tags": "latest"
|
|
8
8
|
},
|
|
9
|
-
"gitHead": "
|
|
9
|
+
"gitHead": "2870bbc0b27fb7f7e4635b6be6000660880d41cd",
|
|
10
10
|
"source": "index.js"
|
|
11
11
|
}
|