@domql/state 2.4.11 → 2.5.1
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/create.js +2 -2
- package/dist/cjs/create.js +3 -1
- package/package.json +2 -2
package/create.js
CHANGED
|
@@ -9,6 +9,7 @@ import { checkIfInherits, createInheritedState } from './inherit'
|
|
|
9
9
|
|
|
10
10
|
export const createState = function (element, parent, options) {
|
|
11
11
|
element.state = applyInitialState(element, parent, options)
|
|
12
|
+
return element.state
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export const applyInitialState = function (element, parent, options) {
|
|
@@ -108,6 +109,5 @@ const applyMethods = (element) => {
|
|
|
108
109
|
Object.setPrototypeOf(state, proto)
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
if (state.parent && state.parent.__children)
|
|
112
|
-
state.parent.__children[element.key] = state
|
|
112
|
+
if (state.parent && state.parent.__children) { state.parent.__children[element.key] = state }
|
|
113
113
|
}
|
package/dist/cjs/create.js
CHANGED
|
@@ -30,6 +30,7 @@ var import_updateState = require("./updateState");
|
|
|
30
30
|
var import_inherit = require("./inherit");
|
|
31
31
|
const createState = function(element, parent, options) {
|
|
32
32
|
element.state = applyInitialState(element, parent, options);
|
|
33
|
+
return element.state;
|
|
33
34
|
};
|
|
34
35
|
const applyInitialState = function(element, parent, options) {
|
|
35
36
|
const objectizeState = checkForTypes(element);
|
|
@@ -119,6 +120,7 @@ const applyMethods = (element) => {
|
|
|
119
120
|
} else {
|
|
120
121
|
Object.setPrototypeOf(state, proto);
|
|
121
122
|
}
|
|
122
|
-
if (state.parent && state.parent.__children)
|
|
123
|
+
if (state.parent && state.parent.__children) {
|
|
123
124
|
state.parent.__children[element.key] = state;
|
|
125
|
+
}
|
|
124
126
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/state",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
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": "40078b6ea7a4b968eb96a7078d33f4cbcd6b199a"
|
|
35
35
|
}
|