@zelgadis87/utils-core 5.2.0 → 5.2.1

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/esbuild/index.mjs CHANGED
@@ -770,23 +770,23 @@ function isError(e) {
770
770
  return e instanceof Error;
771
771
  }
772
772
  function getMessageFromError(error) {
773
- return `${error.name}: ${error.message}${getCauseMessageFromError(error.cause)}`;
773
+ return `${error.name}: ${error.message}${getCauseMessageFromError(error)}`;
774
774
  }
775
775
  function getStackFromError(error) {
776
776
  const stack = error.stack && error.stack.includes(error.message) ? error.stack : error.message + " " + (error.stack ?? "");
777
- return `${error.name}: ${stack}${getCauseStackFromError(error.cause)}`;
777
+ return `${error.name}: ${stack}${getCauseStackFromError(error)}`;
778
778
  }
779
- function getCauseMessageFromError(cause) {
780
- if (isNullOrUndefined(cause))
779
+ function getCauseMessageFromError(error) {
780
+ if (isNullOrUndefined(error.cause))
781
781
  return "";
782
782
  return `
783
- caused by: ${getMessageFromError(asError(cause))}`;
783
+ caused by: ${getMessageFromError(asError(error.cause))}`;
784
784
  }
785
- function getCauseStackFromError(cause) {
786
- if (isNullOrUndefined(cause))
785
+ function getCauseStackFromError(error) {
786
+ if (isNullOrUndefined(error.cause))
787
787
  return "";
788
788
  return `
789
- caused by: ${getStackFromError(asError(cause))}`;
789
+ caused by: ${getStackFromError(asError(error.cause))}`;
790
790
  }
791
791
 
792
792
  // src/utils/json.ts