Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-common-utils

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-common-utils - npm Package Compare versions

Comparing version 1.4.1 to 1.5.1

8

js/StaticUtils.js

@@ -190,8 +190,8 @@ export default class StaticUtils {

static quoteIfString(value) {
return value.constructor == String ? `"${value}"` : value;
static quoteIfString(value, quotingSymbol = '"') {
return value.constructor == String ? `${quotingSymbol}${value}${quotingSymbol}` : value;
}
static safeQuoteIfString(value, quoteIfString) {
return quoteIfString ? StaticUtils.quoteIfString(value) : value;
static safeQuoteIfString(value, quoteIfString, quotingSymbol) {
return quoteIfString ? StaticUtils.quoteIfString(value, quotingSymbol) : value;
}

@@ -198,0 +198,0 @@

{
"name": "simple-common-utils",
"version": "1.4.1",
"version": "1.5.1",
"description": "A collection of utility classes.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -186,12 +186,13 @@ This is a collection of utility classes used for JS development.

Quotes `value` if it's a string.
Quotes `value` if it's a string, using `quotingSymbol`.
StaticUtils.quoteIfString(10); // 10
StaticUtils.quoteIfString("10"); // "10"
StaticUtils.quoteIfString("10", "'"); // '10'
- safeQuoteIfString()
Invokes `quoteIfString()` passing `value` to it if `quoteIfString` is `true`.
Invokes `quoteIfString()` passing `value` and `quotingSymbol` to it if `quoteIfString` is `true`.
StaticUtils.safeQuoteIfString(value, quoteIfString);
StaticUtils.safeQuoteIfString(value, quoteIfString, quotingSymbol);

@@ -251,2 +252,3 @@ - objectToArray()

-|-
v1.5.1|`quotingSymbol` is added to `StaticUtils.quoteIfString() / safeQuoteIfString()`.
v1.4.1|The method `StaticUtils.verify()` is added.

@@ -253,0 +255,0 @@ v1.2.1|`StaticUtils.colorNames` had `00` as alpha. Changed to `FF`.

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc