@domql/utils 3.7.3 → 3.7.4

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.
@@ -228,14 +228,17 @@ const deepMergeExtends = (element, extend, sourcemap, sourceName, preBuiltSource
228
228
  }
229
229
  return element;
230
230
  };
231
- const trackSourcemapDeep = (sourcemap, obj, sourceName) => {
231
+ const trackSourcemapDeep = (sourcemap, obj, sourceName, seen) => {
232
+ if (!seen) seen = /* @__PURE__ */ new WeakSet();
233
+ if (seen.has(obj)) return;
234
+ seen.add(obj);
232
235
  for (const key in obj) {
233
236
  if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
234
237
  if (key === "__proto__" || key === "constructor" || key === "prototype") continue;
235
238
  const val = obj[key];
236
239
  if ((0, import_types.isObject)(val) && !(0, import_types.isArray)(val)) {
237
240
  sourcemap[key] = sourcemap[key] || {};
238
- trackSourcemapDeep(sourcemap[key], val, sourceName);
241
+ trackSourcemapDeep(sourcemap[key], val, sourceName, seen);
239
242
  } else {
240
243
  sourcemap[key] = sourceName;
241
244
  }
@@ -372,12 +372,12 @@ function call(fnKey, ...args) {
372
372
  const result = fn.call(this, ...args);
373
373
  if (result && typeof result.then === "function") {
374
374
  result.catch((err) => {
375
- this.error = err;
375
+ error.call(this, err);
376
376
  });
377
377
  }
378
378
  return result;
379
379
  } catch (err) {
380
- this.error = err;
380
+ error.call(this, err);
381
381
  if (context?.strictMode) throw err;
382
382
  }
383
383
  }
@@ -179,14 +179,17 @@ const deepMergeExtends = (element, extend, sourcemap, sourceName, preBuiltSource
179
179
  }
180
180
  return element;
181
181
  };
182
- const trackSourcemapDeep = (sourcemap, obj, sourceName) => {
182
+ const trackSourcemapDeep = (sourcemap, obj, sourceName, seen) => {
183
+ if (!seen) seen = /* @__PURE__ */ new WeakSet();
184
+ if (seen.has(obj)) return;
185
+ seen.add(obj);
183
186
  for (const key in obj) {
184
187
  if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
185
188
  if (key === "__proto__" || key === "constructor" || key === "prototype") continue;
186
189
  const val = obj[key];
187
190
  if (isObject(val) && !isArray(val)) {
188
191
  sourcemap[key] = sourcemap[key] || {};
189
- trackSourcemapDeep(sourcemap[key], val, sourceName);
192
+ trackSourcemapDeep(sourcemap[key], val, sourceName, seen);
190
193
  } else {
191
194
  sourcemap[key] = sourceName;
192
195
  }
@@ -309,12 +309,12 @@ function call(fnKey, ...args) {
309
309
  const result = fn.call(this, ...args);
310
310
  if (result && typeof result.then === "function") {
311
311
  result.catch((err) => {
312
- this.error = err;
312
+ error.call(this, err);
313
313
  });
314
314
  }
315
315
  return result;
316
316
  } catch (err) {
317
- this.error = err;
317
+ error.call(this, err);
318
318
  if (context?.strictMode) throw err;
319
319
  }
320
320
  }
@@ -3345,14 +3345,17 @@ var DomqlUtils = (() => {
3345
3345
  }
3346
3346
  return element;
3347
3347
  };
3348
- var trackSourcemapDeep = (sourcemap, obj, sourceName) => {
3348
+ var trackSourcemapDeep = (sourcemap, obj, sourceName, seen) => {
3349
+ if (!seen) seen = /* @__PURE__ */ new WeakSet();
3350
+ if (seen.has(obj)) return;
3351
+ seen.add(obj);
3349
3352
  for (const key in obj) {
3350
3353
  if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
3351
3354
  if (key === "__proto__" || key === "constructor" || key === "prototype") continue;
3352
3355
  const val = obj[key];
3353
3356
  if (isObject(val) && !isArray(val)) {
3354
3357
  sourcemap[key] = sourcemap[key] || {};
3355
- trackSourcemapDeep(sourcemap[key], val, sourceName);
3358
+ trackSourcemapDeep(sourcemap[key], val, sourceName, seen);
3356
3359
  } else {
3357
3360
  sourcemap[key] = sourceName;
3358
3361
  }
@@ -4465,12 +4468,12 @@ var DomqlUtils = (() => {
4465
4468
  const result = fn.call(this, ...args);
4466
4469
  if (result && typeof result.then === "function") {
4467
4470
  result.catch((err) => {
4468
- this.error = err;
4471
+ error.call(this, err);
4469
4472
  });
4470
4473
  }
4471
4474
  return result;
4472
4475
  } catch (err) {
4473
- this.error = err;
4476
+ error.call(this, err);
4474
4477
  if (context?.strictMode) throw err;
4475
4478
  }
4476
4479
  }
package/extends.js CHANGED
@@ -252,14 +252,17 @@ export const deepMergeExtends = (element, extend, sourcemap, sourceName, preBuil
252
252
  return element
253
253
  }
254
254
 
255
- const trackSourcemapDeep = (sourcemap, obj, sourceName) => {
255
+ const trackSourcemapDeep = (sourcemap, obj, sourceName, seen) => {
256
+ if (!seen) seen = new WeakSet()
257
+ if (seen.has(obj)) return
258
+ seen.add(obj)
256
259
  for (const key in obj) {
257
260
  if (!Object.prototype.hasOwnProperty.call(obj, key)) continue
258
261
  if (key === '__proto__' || key === 'constructor' || key === 'prototype') continue
259
262
  const val = obj[key]
260
263
  if (isObject(val) && !isArray(val)) {
261
264
  sourcemap[key] = sourcemap[key] || {}
262
- trackSourcemapDeep(sourcemap[key], val, sourceName)
265
+ trackSourcemapDeep(sourcemap[key], val, sourceName, seen)
263
266
  } else {
264
267
  sourcemap[key] = sourceName
265
268
  }
package/methods.js CHANGED
@@ -389,12 +389,12 @@ export function call (fnKey, ...args) {
389
389
  const result = fn.call(this, ...args)
390
390
  if (result && typeof result.then === 'function') {
391
391
  result.catch((err) => {
392
- this.error = err
392
+ error.call(this, err)
393
393
  })
394
394
  }
395
395
  return result
396
396
  } catch (err) {
397
- this.error = err
397
+ error.call(this, err)
398
398
  if (context?.strictMode) throw err
399
399
  }
400
400
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "3.7.3",
3
+ "version": "3.7.4",
4
4
  "license": "CC-BY-NC-4.0",
5
5
  "type": "module",
6
6
  "module": "./dist/esm/index.js",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
40
40
  "peerDependencies": {
41
- "@symbo.ls/fetch": "^3.7.3"
41
+ "@symbo.ls/fetch": "^3.7.4"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "@symbo.ls/fetch": {