cleaner-node
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "cleaner-node", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"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": "index.js", |
@@ -9,2 +9,6 @@ const cc = require('camelcase'); | ||
const isPossible = value => { | ||
return ['string', 'number', 'boolean', 'undefined'].indexOf(typeof value) >= 0; | ||
} | ||
const has = (value, target, isCaseSensitive = false) => { | ||
@@ -198,2 +202,10 @@ if (typeof value !== 'string') { return false; } | ||
const padLeft = (value, length = 2, character = '0') => { | ||
if (!isPossible(value)) { return value; } | ||
let padding = ''; | ||
while ((padding + String(value)).length < length) { | ||
padding += character; | ||
} | ||
return `${padding}${String(value)}`; | ||
} | ||
@@ -216,2 +228,3 @@ module.exports = { | ||
unique, | ||
isPossible, | ||
isValid, | ||
@@ -233,3 +246,5 @@ isValidChars, | ||
endsWith, | ||
removeSuffix | ||
removeSuffix, | ||
padLeft | ||
}; |
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
44593
1105