@domql/state 2.28.2 → 2.28.18

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.
@@ -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;
@@ -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.2",
3
+ "version": "2.28.18",
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.2",
32
- "@domql/report": "^2.28.2",
33
- "@domql/utils": "^2.28.2"
31
+ "@domql/event": "^2.28.18",
32
+ "@domql/report": "^2.28.18",
33
+ "@domql/utils": "^2.28.18"
34
34
  },
35
- "gitHead": "3c5e8b68269799a0e2382f9c79c51e41f33863bf"
35
+ "gitHead": "09442a79ea4ff9b05ab22cf63770f25d979f0264"
36
36
  }