diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2017-01-26 17:21:26 +0100 |
---|---|---|
committer | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2017-01-30 14:47:24 -0500 |
commit | afb7c1bac87d943a9ca6422c7100e0e3fe291740 (patch) | |
tree | 1ce1f8214473a200de9de52989c1ec8aad8ddf89 /deps/npm/node_modules/JSONStream/index.js | |
parent | 5de3cf099cd01c84d1809dab90c041b76aa58d8e (diff) | |
download | android-node-v8-afb7c1bac87d943a9ca6422c7100e0e3fe291740.tar.gz android-node-v8-afb7c1bac87d943a9ca6422c7100e0e3fe291740.tar.bz2 android-node-v8-afb7c1bac87d943a9ca6422c7100e0e3fe291740.zip |
deps: upgrade npm to 4.1.2
PR-URL: https://github.com/nodejs/node/pull/11020
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'deps/npm/node_modules/JSONStream/index.js')
-rwxr-xr-x | deps/npm/node_modules/JSONStream/index.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/deps/npm/node_modules/JSONStream/index.js b/deps/npm/node_modules/JSONStream/index.js index 701b1fa4ae..86ad5c7443 100755 --- a/deps/npm/node_modules/JSONStream/index.js +++ b/deps/npm/node_modules/JSONStream/index.js @@ -58,6 +58,7 @@ exports.parse = function (path, map) { var i = 0 // iterates on path var j = 0 // iterates on stack var emitKey = false; + var emitPath = false; while (i < path.length) { var key = path[i] var c @@ -71,6 +72,7 @@ exports.parse = function (path, map) { return } emitKey = !!key.emitKey; + emitPath = !!key.emitPath; i++ } else { i++ @@ -99,7 +101,14 @@ exports.parse = function (path, map) { var data = this.value[this.key] if(null != data) if(null != (data = map ? map(data, actualPath) : data)) { - data = emitKey ? { value: data, key: this.key } : data; + if (emitKey || emitPath) { + data = { value: data }; + if (emitKey) + data["key"] = this.key; + if (emitPath) + data["path"] = actualPath; + } + stream.queue(data) } delete this.value[this.key] |