Socket
Socket
Sign inDemoInstall

simple-common-utils

Package Overview
Dependencies
0
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.4.0 to 2.5.0

20

js/StaticUtils.js

@@ -179,2 +179,22 @@ export default class StaticUtils {

static formatError(error) {
let result = "Start of error output:\n";
Object.entries(error).forEach(entry => {
const value = entry[1];
const stringifier = [
Array,
Object,
undefined
].includes(value?.constructor) ? JSON.stringify : obj => obj.toString();
result += `${entry[0]}: ${stringifier(value)}\n`;
});
result += "End of error output";
return result;
}
static objectToArray(object) {

@@ -181,0 +201,0 @@ return Object.keys(object).reduce((p, c) => {

2

package.json

@@ -21,3 +21,3 @@ {

},
"version": "2.4.0"
"version": "2.5.0"
}

@@ -183,2 +183,6 @@ This is a collection of utility classes used for JS development.

- formatError(error)
Enumerates the fields of the given argument with `Object.entries()` and returns a string based on the result.
- objectToArray()

@@ -254,2 +258,3 @@

-|-
v2.5.0|`StaticUtils.formatError()` added.
v2.4.0|1. `StaticUtils.today()`: `returnNow` added.<br>2. `package.json`: fields alphabetized.

@@ -256,0 +261,0 @@ v2.3.0|`StaticUtils.today()` added.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc