@domql/utils 2.3.7 → 2.3.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 +17 -0
- package/package.json +2 -2
package/object.js
CHANGED
|
@@ -176,3 +176,20 @@ export const flattenRecursive = (param, prop, stack = []) => {
|
|
|
176
176
|
|
|
177
177
|
return stack
|
|
178
178
|
}
|
|
179
|
+
|
|
180
|
+
export const isEqualDeep = (param, element) => {
|
|
181
|
+
if (param === element) return true
|
|
182
|
+
if (!param || !element) return false
|
|
183
|
+
for (const prop in param) {
|
|
184
|
+
const paramProp = param[prop]
|
|
185
|
+
const elementProp = element[prop]
|
|
186
|
+
if (isObjectLike(paramProp)) {
|
|
187
|
+
const isEqual = isEqualDeep(paramProp, elementProp)
|
|
188
|
+
if (!isEqual) return false
|
|
189
|
+
} else {
|
|
190
|
+
const isEqual = paramProp === elementProp
|
|
191
|
+
if (!isEqual) return false
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return true
|
|
195
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/utils",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.8",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@domql/tags": "latest"
|
|
8
8
|
},
|
|
9
|
-
"gitHead": "
|
|
9
|
+
"gitHead": "0806fd53e029721c87db84d21a3e46a8a23cef24",
|
|
10
10
|
"source": "index.js"
|
|
11
11
|
}
|