@domql/utils 2.3.82 → 2.3.84

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.
@@ -167,12 +167,22 @@ const detachFunctionsFromObject = (obj, detached = {}) => {
167
167
  continue;
168
168
  else if ((0, import_types.isObject)(objProp)) {
169
169
  detached[prop] = {};
170
- deepStringify(objProp[prop], detached[prop]);
170
+ deepStringify(objProp, detached[prop]);
171
171
  } else if ((0, import_types.isArray)(objProp)) {
172
172
  detached[prop] = [];
173
- objProp.map((v, i) => deepStringify(v, detached[prop][i]));
174
- } else
173
+ objProp.forEach((v, i) => {
174
+ if ((0, import_types.isFunction)(v))
175
+ return;
176
+ if ((0, import_types.isObject)(v)) {
177
+ detached[prop][i] = {};
178
+ detachFunctionsFromObject(v, detached[prop][i]);
179
+ } else {
180
+ detached[prop][i] = v;
181
+ }
182
+ });
183
+ } else {
175
184
  detached[prop] = objProp;
185
+ }
176
186
  }
177
187
  return detached;
178
188
  };
package/object.js CHANGED
@@ -147,11 +147,21 @@ export const detachFunctionsFromObject = (obj, detached = {}) => {
147
147
  if (isFunction(objProp)) continue
148
148
  else if (isObject(objProp)) {
149
149
  detached[prop] = {}
150
- deepStringify(objProp[prop], detached[prop])
150
+ deepStringify(objProp, detached[prop])
151
151
  } else if (isArray(objProp)) {
152
152
  detached[prop] = []
153
- objProp.map((v, i) => deepStringify(v, detached[prop][i]))
154
- } else detached[prop] = objProp
153
+ objProp.forEach((v, i) => {
154
+ if (isFunction(v)) return
155
+ if (isObject(v)) {
156
+ detached[prop][i] = {}
157
+ detachFunctionsFromObject(v, detached[prop][i])
158
+ } else {
159
+ detached[prop][i] = v
160
+ }
161
+ })
162
+ } else {
163
+ detached[prop] = objProp
164
+ }
155
165
  }
156
166
  return detached
157
167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "2.3.82",
3
+ "version": "2.3.84",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -22,5 +22,5 @@
22
22
  "@domql/globals": "latest",
23
23
  "@domql/tags": "latest"
24
24
  },
25
- "gitHead": "6d358ffa05e6acdceacc1d053fdb00449610b43a"
25
+ "gitHead": "f009c1f04bd530e12af3edf3cb168154a7a55e11"
26
26
  }