Socket
Socket
Sign inDemoInstall

cleaner-node

Package Overview
Dependencies
Maintainers
1
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cleaner-node - npm Package Compare versions

Comparing version 0.17.5 to 0.17.6

2

package.json
{
"name": "cleaner-node",
"version": "0.17.5",
"version": "0.17.6",
"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",

@@ -169,7 +169,7 @@ const { isValid: isValidString, toCamelCase } = require('./strings');

// ----- prune
const _prune = obj => {
const _prune = (obj, deNull) => {
if (typeof obj !== 'object' || obj === null) { return; }
if (obj instanceof Array) {
for (let i = 0; i < obj.length; i += 1) {
_prune(obj[i]);
_prune(obj[i], deNull);
}

@@ -184,3 +184,3 @@ return;

.forEach(key => {
_prune(obj[key]);
_prune(obj[key], deNull);
});

@@ -208,2 +208,10 @@

// Null values
if (deNull) {
keys.filter(key => (obj[key] === null))
.forEach(key => {
Reflect.deleteProperty(obj, key);
});
}
// Empty Objects

@@ -215,5 +223,5 @@ keys.filter(key => (isValid(obj[key]) && !(obj[key] instanceof Date) && Object.keys(obj[key]).filter(isValidString).length === 0))

};
const prune = obj => {
const prune = (obj, deNull = false) => {
const result = { obj };
_prune(result);
_prune(result, deNull);
return result.obj;

@@ -220,0 +228,0 @@ };

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