cleaner-node
Advanced tools
Comparing version 1.0.32 to 1.0.33
{ | ||
"name" : "cleaner-node", | ||
"version" : "1.0.32", | ||
"version" : "1.0.33", | ||
"description" : "Helpful utilities and scripts to make Node projects more legible and easier for the next developer to take over.", | ||
@@ -5,0 +5,0 @@ "main" : "src/index.js", |
@@ -150,2 +150,3 @@ const addDays = require('./add-days'); | ||
const uniqueStrings = require('./unique-strings'); | ||
const unquote = require('./unquote'); | ||
const walk = require('./walk'); | ||
@@ -312,2 +313,3 @@ const writeFile = require('./write-file'); | ||
uniqueStrings, | ||
unquote, | ||
walk, | ||
@@ -325,2 +327,3 @@ writeFile, | ||
toReq : toRequest, | ||
unQuote : unquote, | ||
@@ -327,0 +330,0 @@ fromBlockDate: blockdate.fromBlockDate, |
@@ -202,4 +202,3 @@ const isFile = require('./is-file'); | ||
curNode.children.push(newItem); | ||
curNode.children.push(newItem); | ||
} | ||
@@ -206,0 +205,0 @@ |
const isValidString = require('./is-valid-string'); | ||
const getPads = require('./get-pads'); | ||
const { QUOTE } = require('../constants'); | ||
const isDigits = value => { | ||
return isValidString(value) && | ||
value | ||
.split('') | ||
.filter(ch => ('0123456789'.includes(ch))).join('') === value; | ||
const unQuote = value => { | ||
if (!isValidString(value)) { | ||
return value; | ||
} | ||
if (value.trim().length < 3) { | ||
return value; | ||
} | ||
const pads = getPads(value); | ||
const prefix = pads.prefix > 0 ? value.substring(0, pads.prefix) : ''; | ||
const suffix = pads.suffix > 0 ? value.substring(value.length - pads.suffix) : ''; | ||
const trimmed = value.trim(); | ||
const first = trimmed.substring(0, 1); | ||
const last = trimmed.substring(trimmed.length - 1); | ||
if (first !== QUOTE || last !== QUOTE) { | ||
return value; | ||
} | ||
let result = trimmed.substring(1); | ||
result = result.substring(0, result.length - 1); | ||
return prefix + result + suffix; | ||
}; | ||
module.exports = isDigits; | ||
module.exports = unQuote; |
@@ -69,5 +69,6 @@ # Updates | ||
## v1.0.32 (5/19/2024) | ||
## v1.0.32-33 (5/19/2024) | ||
* add `getPadPrefix` | ||
* add `getPadSuffix` | ||
* add `unquote` |
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
171190
4612