@andrew_l/toolkit 0.2.16 → 0.2.17

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/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Toolkit <!-- omit in toc -->
1
+ # Toolkit
2
2
 
3
- ![license](https://img.shields.io/npm/l/%40andrew_l%2Ftoolkit) <!-- omit in toc -->
4
- ![npm version](https://img.shields.io/npm/v/%40andrew_l%2Ftoolkit) <!-- omit in toc -->
5
- ![npm bundle size](https://img.shields.io/bundlephobia/minzip/%40andrew_l%2Ftoolkit) <!-- omit in toc -->
3
+ ![license](https://img.shields.io/npm/l/%40andrew_l%2Ftoolkit)
4
+ ![npm version](https://img.shields.io/npm/v/%40andrew_l%2Ftoolkit)
5
+ ![npm bundle size](https://img.shields.io/bundlephobia/minzip/%40andrew_l%2Ftoolkit)
6
6
 
7
7
  A personal collection of utility JavaScript functions that have been developed and refined over the years. This toolkit contains a variety of helper functions aimed at making everyday JavaScript tasks easier, more efficient, and maintainable.
8
8
 
package/dist/index.cjs CHANGED
@@ -435,7 +435,7 @@ function createCustomizerFactory(fn) {
435
435
  def(fn, WITH_CUSTOMIZER_FACTORY_SYM, true);
436
436
  return fn;
437
437
  }
438
- function createSecureCustomizer(properties) {
438
+ function createSecureCustomizer(properties, opts) {
439
439
  const secureLabel = `<** secure **>`;
440
440
  const circularLabel = `<** circular **>`;
441
441
  const propertiesSet = Object.freeze(
@@ -451,11 +451,12 @@ function createSecureCustomizer(properties) {
451
451
  return circularLabel;
452
452
  }
453
453
  seenSet.add(value);
454
- if (isError(value)) {
454
+ if (isError(value) && opts?.normalizeError !== false) {
455
455
  return {
456
456
  message: value.message,
457
457
  stack: value.stack,
458
- name: value.name
458
+ name: value.name,
459
+ cause: value.cause !== void 0 ? withCustomizer(seenSet, value.cause) : void 0
459
460
  };
460
461
  }
461
462
  };