@domql/state 2.28.2 → 2.28.23
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/cjs/methods.js +4 -4
- package/dist/esm/methods.js +4 -4
- package/methods.js +4 -4
- package/package.json +5 -5
package/dist/cjs/methods.js
CHANGED
|
@@ -152,7 +152,7 @@ const setByPath = function(path, val, options = {}) {
|
|
|
152
152
|
if (options.preventStateUpdate) return update;
|
|
153
153
|
return state.update(update, options);
|
|
154
154
|
};
|
|
155
|
-
const setPathCollection = function(changes, options = {}) {
|
|
155
|
+
const setPathCollection = async function(changes, options = {}) {
|
|
156
156
|
const state = this;
|
|
157
157
|
const update = changes.reduce((acc, change) => {
|
|
158
158
|
if (change[0] === "update") {
|
|
@@ -163,13 +163,13 @@ const setPathCollection = function(changes, options = {}) {
|
|
|
163
163
|
}
|
|
164
164
|
return acc;
|
|
165
165
|
}, {});
|
|
166
|
-
return state.update(update, options);
|
|
166
|
+
return await state.update(update, options);
|
|
167
167
|
};
|
|
168
|
-
const removeByPath = function(path, options = {}) {
|
|
168
|
+
const removeByPath = async function(path, options = {}) {
|
|
169
169
|
const state = this;
|
|
170
170
|
(0, import_utils.removeNestedKeyByPath)(state, path);
|
|
171
171
|
if (options.preventUpdate) return path;
|
|
172
|
-
return state.update({}, options);
|
|
172
|
+
return await state.update({}, options);
|
|
173
173
|
};
|
|
174
174
|
const removePathCollection = function(changes, options = {}) {
|
|
175
175
|
const state = this;
|
package/dist/esm/methods.js
CHANGED
|
@@ -136,7 +136,7 @@ const setByPath = function(path, val, options = {}) {
|
|
|
136
136
|
if (options.preventStateUpdate) return update;
|
|
137
137
|
return state.update(update, options);
|
|
138
138
|
};
|
|
139
|
-
const setPathCollection = function(changes, options = {}) {
|
|
139
|
+
const setPathCollection = async function(changes, options = {}) {
|
|
140
140
|
const state = this;
|
|
141
141
|
const update = changes.reduce((acc, change) => {
|
|
142
142
|
if (change[0] === "update") {
|
|
@@ -147,13 +147,13 @@ const setPathCollection = function(changes, options = {}) {
|
|
|
147
147
|
}
|
|
148
148
|
return acc;
|
|
149
149
|
}, {});
|
|
150
|
-
return state.update(update, options);
|
|
150
|
+
return await state.update(update, options);
|
|
151
151
|
};
|
|
152
|
-
const removeByPath = function(path, options = {}) {
|
|
152
|
+
const removeByPath = async function(path, options = {}) {
|
|
153
153
|
const state = this;
|
|
154
154
|
removeNestedKeyByPath(state, path);
|
|
155
155
|
if (options.preventUpdate) return path;
|
|
156
|
-
return state.update({}, options);
|
|
156
|
+
return await state.update({}, options);
|
|
157
157
|
};
|
|
158
158
|
const removePathCollection = function(changes, options = {}) {
|
|
159
159
|
const state = this;
|
package/methods.js
CHANGED
|
@@ -137,7 +137,7 @@ export const setByPath = function (path, val, options = {}) {
|
|
|
137
137
|
return state.update(update, options)
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
export const setPathCollection = function (changes, options = {}) {
|
|
140
|
+
export const setPathCollection = async function (changes, options = {}) {
|
|
141
141
|
const state = this
|
|
142
142
|
const update = changes.reduce((acc, change) => {
|
|
143
143
|
if (change[0] === 'update') {
|
|
@@ -148,14 +148,14 @@ export const setPathCollection = function (changes, options = {}) {
|
|
|
148
148
|
}
|
|
149
149
|
return acc
|
|
150
150
|
}, {})
|
|
151
|
-
return state.update(update, options)
|
|
151
|
+
return await state.update(update, options)
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
export const removeByPath = function (path, options = {}) {
|
|
154
|
+
export const removeByPath = async function (path, options = {}) {
|
|
155
155
|
const state = this
|
|
156
156
|
removeNestedKeyByPath(state, path)
|
|
157
157
|
if (options.preventUpdate) return path
|
|
158
|
-
return state.update({}, options)
|
|
158
|
+
return await state.update({}, options)
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
export const removePathCollection = function (changes, options = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/state",
|
|
3
|
-
"version": "2.28.
|
|
3
|
+
"version": "2.28.23",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"prepublish": "npx rimraf -I dist && npm run build && npm run copy:package:cjs"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@domql/event": "^2.28.
|
|
32
|
-
"@domql/report": "^2.28.
|
|
33
|
-
"@domql/utils": "^2.28.
|
|
31
|
+
"@domql/event": "^2.28.23",
|
|
32
|
+
"@domql/report": "^2.28.23",
|
|
33
|
+
"@domql/utils": "^2.28.23"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "872c73ebfcbf893f9f42b49687f0aff8c79f559d"
|
|
36
36
|
}
|