aboutsummaryrefslogtreecommitdiff
path: root/node_modules/stringify-object
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
commitbbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch)
treec58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/stringify-object
parent003fb34971cf63466184351b4db5f7c67df4f444 (diff)
downloadwallet-core-bbff7403fbf46f9ad92240ac213df8d30ef31b64.tar.xz
update packages
Diffstat (limited to 'node_modules/stringify-object')
-rw-r--r--node_modules/stringify-object/index.js12
-rw-r--r--node_modules/stringify-object/package.json79
-rw-r--r--node_modules/stringify-object/readme.md4
3 files changed, 46 insertions, 49 deletions
diff --git a/node_modules/stringify-object/index.js b/node_modules/stringify-object/index.js
index 4a55bd9ec..a60caef59 100644
--- a/node_modules/stringify-object/index.js
+++ b/node_modules/stringify-object/index.js
@@ -1,7 +1,7 @@
'use strict';
const isRegexp = require('is-regexp');
const isObj = require('is-obj');
-const getOwnEnumPropSymbols = require('get-own-enumerable-property-symbols');
+const getOwnEnumPropSymbols = require('get-own-enumerable-property-symbols').default;
module.exports = (val, opts, pad) => {
const seen = [];
@@ -89,7 +89,11 @@ module.exports = (val, opts, pad) => {
}
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) {
return '{}';
@@ -98,10 +102,6 @@ module.exports = (val, opts, pad) => {
seen.push(val);
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;
const isSymbol = typeof el === 'symbol';
const isClassic = !isSymbol && /^[a-z$_][a-z$_0-9]*$/i.test(el);
diff --git a/node_modules/stringify-object/package.json b/node_modules/stringify-object/package.json
index 625864260..4b918bf9c 100644
--- a/node_modules/stringify-object/package.json
+++ b/node_modules/stringify-object/package.json
@@ -1,43 +1,40 @@
{
- "name": "stringify-object",
- "version": "3.2.0",
- "description": "Stringify an object/array like JSON.stringify just without all the double-quotes",
- "license": "BSD-2-Clause",
- "repository": "yeoman/stringify-object",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "engines": {
- "node": ">=4"
- },
- "scripts": {
- "test": "xo && mocha"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "object",
- "stringify",
- "pretty",
- "print",
- "dump",
- "format",
- "type",
- "json"
- ],
- "dependencies": {
- "get-own-enumerable-property-symbols": "^1.0.1",
- "is-obj": "^1.0.1",
- "is-regexp": "^1.0.0"
- },
- "devDependencies": {
- "mocha": "*",
- "xo": "*"
- },
- "xo": {
- "esnext": true
- }
+ "name": "stringify-object",
+ "version": "3.2.2",
+ "description": "Stringify an object/array like JSON.stringify just without all the double-quotes",
+ "license": "BSD-2-Clause",
+ "repository": "yeoman/stringify-object",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "object",
+ "stringify",
+ "pretty",
+ "print",
+ "dump",
+ "format",
+ "type",
+ "json"
+ ],
+ "dependencies": {
+ "get-own-enumerable-property-symbols": "^2.0.1",
+ "is-obj": "^1.0.1",
+ "is-regexp": "^1.0.0"
+ },
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ }
}
diff --git a/node_modules/stringify-object/readme.md b/node_modules/stringify-object/readme.md
index 177f05445..5a3542bd9 100644
--- a/node_modules/stringify-object/readme.md
+++ b/node_modules/stringify-object/readme.md
@@ -10,7 +10,7 @@ It also handles circular references and lets you specify quote type.
## Install
```
-$ npm install --save stringify-object
+$ npm install stringify-object
```
@@ -62,7 +62,7 @@ Type: `Object` `Array`
##### indent
Type: `string`<br>
-Default: `'\t'`
+Default: `\t`
Preferred indentation.