@domql/state 2.3.150 → 2.3.152
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/createState.js +1 -4
- package/dist/cjs/createState.js +3 -2
- package/dist/cjs/inherit.js +2 -0
- package/inherit.js +2 -0
- package/package.json +2 -2
package/createState.js
CHANGED
|
@@ -27,10 +27,7 @@ export const createState = function (element, parent, options) {
|
|
|
27
27
|
|
|
28
28
|
// NOTE: Only true when 'onlyResolveExtends' option is set to true
|
|
29
29
|
if (skipApplyMethods) {
|
|
30
|
-
if (element.parent && element.parent.state)
|
|
31
|
-
element.state.parent = element.parent.state
|
|
32
|
-
else
|
|
33
|
-
element.state.parent = {}
|
|
30
|
+
if (element.parent && element.parent.state) { element.state.parent = element.parent.state } else { element.state.parent = {} }
|
|
34
31
|
return element.state
|
|
35
32
|
}
|
|
36
33
|
|
package/dist/cjs/createState.js
CHANGED
|
@@ -45,10 +45,11 @@ const createState = function(element, parent, options) {
|
|
|
45
45
|
if (dependentState)
|
|
46
46
|
element.state = dependentState;
|
|
47
47
|
if (skipApplyMethods) {
|
|
48
|
-
if (element.parent && element.parent.state)
|
|
48
|
+
if (element.parent && element.parent.state) {
|
|
49
49
|
element.state.parent = element.parent.state;
|
|
50
|
-
else
|
|
50
|
+
} else {
|
|
51
51
|
element.state.parent = {};
|
|
52
|
+
}
|
|
52
53
|
return element.state;
|
|
53
54
|
}
|
|
54
55
|
applyMethods(element);
|
package/dist/cjs/inherit.js
CHANGED
|
@@ -47,6 +47,8 @@ const getChildStateInKey = (stateKey, parentState, options = {}) => {
|
|
|
47
47
|
for (let i = 0; i < arrLength; i++) {
|
|
48
48
|
const childKey = arr[i];
|
|
49
49
|
const grandChildKey = arr[i + 1];
|
|
50
|
+
if (childKey === "__proto__" || grandChildKey === "__proto__")
|
|
51
|
+
return;
|
|
50
52
|
let childInParent = parentState[childKey];
|
|
51
53
|
if (!childInParent)
|
|
52
54
|
childInParent = parentState[childKey] = {};
|
package/inherit.js
CHANGED
|
@@ -21,6 +21,8 @@ export const getChildStateInKey = (stateKey, parentState, options = {}) => {
|
|
|
21
21
|
const childKey = arr[i]
|
|
22
22
|
const grandChildKey = arr[i + 1]
|
|
23
23
|
|
|
24
|
+
if (childKey === '__proto__' || grandChildKey === '__proto__') return
|
|
25
|
+
|
|
24
26
|
let childInParent = parentState[childKey]
|
|
25
27
|
if (!childInParent) childInParent = parentState[childKey] = {} // check for array
|
|
26
28
|
if (!childInParent[grandChildKey]) childInParent[grandChildKey] = {} // check for array
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/state",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.152",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"@domql/report": "latest",
|
|
32
32
|
"@domql/utils": "latest"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "9424c9efe8b2b9e4b39bf7dfac3caf1f964ddb9a"
|
|
35
35
|
}
|