simple-common-utils
Advanced tools
Comparing version 1.4.1 to 1.5.1
@@ -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`. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20658
259