cleaner-node
Advanced tools
Comparing version 0.6.11 to 0.6.12
{ | ||
"name": "cleaner-node", | ||
"version": "0.6.11", | ||
"version": "0.6.12", | ||
"description": "Helpful utilities and scripts to make Node projects more legible and easier for the next developer to take over.", | ||
@@ -38,3 +38,3 @@ "main": "index.js", | ||
"gravatar": "^1.8.0", | ||
"is-html": "^1.1.0", | ||
"is-html": "^2.0.0", | ||
"jsonwebtoken": "^8.5.1", | ||
@@ -44,16 +44,16 @@ "know-your-http-well": "^0.5.0", | ||
"moment": "^2.24.0", | ||
"semver": "^5.7.0", | ||
"uuid": "^3.3.2", | ||
"semver": "^6.3.0", | ||
"uuid": "^3.3.3", | ||
"uuid-validate": "0.0.3" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^5.16.0", | ||
"eslint-config-airbnb": "^17.1.0", | ||
"eslint-config-standard": "^12.0.0", | ||
"eslint-plugin-import": "^2.16.0", | ||
"eslint-plugin-node": "^8.0.1", | ||
"eslint-plugin-promise": "^4.1.1", | ||
"eslint-plugin-react": "^7.12.4", | ||
"eslint-plugin-standard": "^4.0.0" | ||
"eslint": "^6.5.1", | ||
"eslint-config-airbnb": "^18.0.1", | ||
"eslint-config-standard": "^14.1.0", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-node": "^10.0.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-react": "^7.15.0", | ||
"eslint-plugin-standard": "^4.0.1" | ||
} | ||
} |
@@ -21,1 +21,2 @@ # cleaner-node | ||
| 0.6.7 | 2019/04/26 | Add `.reduce` to `objects` to remove useless properties. | | ||
| 0.6.12 | 2019/10/01 | Add `.isEmpty` to `objects` to differentiate between empty and invalid. | |
@@ -11,2 +11,3 @@ const strings = require('./strings'); | ||
(typeof value === 'object') && | ||
(value !== null) && | ||
(value instanceof Array) && | ||
@@ -21,3 +22,3 @@ (isEmptyOkay || value.length > 0) | ||
const toArray = valueOrValues => ([].concat(valueOrValues).filter(x => (typeof x !== 'undefined'))); | ||
const toArray = valueOrValues => ([].concat(valueOrValues).filter(x => (typeof x !== 'undefined' && x !== null))); | ||
@@ -24,0 +25,0 @@ const join = (values, delimeter = ',') => { |
@@ -7,4 +7,4 @@ const TRUE_STRINGS = ['true', 'yes', 'on', '1']; | ||
if (typeof value === 'string') { | ||
if (TRUE_STRINGS.indexOf(value.toLowerCase())) { return true; } | ||
if (FALSE_STRINGS.indexOf(value.toLowerCase())) { return false; } | ||
if (TRUE_STRINGS.includes(value.toLowerCase())) { return true; } | ||
if (FALSE_STRINGS.includes(value.toLowerCase())) { return false; } | ||
return undefined; | ||
@@ -11,0 +11,0 @@ } |
@@ -5,2 +5,10 @@ const { isValid: isValidString } = require('./strings'); | ||
const isValid = value => (typeof value === 'object' && !(value instanceof Array)); | ||
const isEmpty = value => { | ||
if (!isValid(value)) { return false; } | ||
return Object.keys(value).filter(key => { | ||
return (key && | ||
key.trim().length > 0 && | ||
(typeof value[key] !== 'undefined')); | ||
}).length === 0; | ||
} | ||
@@ -199,2 +207,3 @@ const getId = item => { | ||
isDefined, | ||
isEmpty, | ||
isValid, | ||
@@ -201,0 +210,0 @@ notDefined, |
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
61354
1562
22
+ Addedhtml-tags@3.3.1(transitive)
+ Addedis-html@2.0.0(transitive)
+ Addedsemver@6.3.1(transitive)
- Removedhtml-tags@1.2.0(transitive)
- Removedis-html@1.1.0(transitive)
Updatedis-html@^2.0.0
Updatedsemver@^6.3.0
Updateduuid@^3.3.3