stringify-object
Advanced tools
Comparing version 3.2.1 to 3.2.2
10
index.js
@@ -92,4 +92,8 @@ 'use strict'; | ||
if (isObj(val)) { | ||
const objKeys = Object.keys(val).concat(getOwnEnumPropSymbols(val)); | ||
let objKeys = Object.keys(val).concat(getOwnEnumPropSymbols(val)); | ||
if (opts.filter) { | ||
objKeys = objKeys.filter(el => opts.filter(val, el)); | ||
} | ||
if (objKeys.length === 0) { | ||
@@ -102,6 +106,2 @@ return '{}'; | ||
const ret = '{' + tokens.newLine + objKeys.map((el, i) => { | ||
if (opts.filter && !opts.filter(val, el)) { | ||
return ''; | ||
} | ||
const eol = objKeys.length - 1 === i ? tokens.newLine : ',' + tokens.newLineOrSpace; | ||
@@ -108,0 +108,0 @@ const isSymbol = typeof el === 'symbol'; |
{ | ||
"name": "stringify-object", | ||
"version": "3.2.1", | ||
"version": "3.2.2", | ||
"description": "Stringify an object/array like JSON.stringify just without all the double-quotes", | ||
@@ -5,0 +5,0 @@ "license": "BSD-2-Clause", |
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
8175