[Pkg-javascript-commits] [node-jsonstream] 138/214: Remove 'root' event
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 1 12:58:51 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-jsonstream.
commit 97d973ac59d0e58748cec98ea87aae36e057d368
Author: Santiago Gimeno <santiago.gimeno at quantion.es>
Date: Mon Mar 9 10:22:26 2015 +0100
Remove 'root' event
- After releasing v1.0.0 this functionality is not working correctly anymore.
- As commented in
https://github.com/dominictarr/JSONStream/issues/32#issuecomment-73962807
people needing this feature should stick to JSONStream at 0.x.x versions.
---
index.js | 1 -
readme.markdown | 6 ------
test/multiple_objects_error.js | 6 ------
test/non_object_roots.js | 16 ----------------
4 files changed, 29 deletions(-)
diff --git a/index.js b/index.js
index 38494e7..3313525 100755
--- a/index.js
+++ b/index.js
@@ -96,7 +96,6 @@ exports.parse = function (path, map) {
if (stream.root) {
if(!path)
stream.queue(stream.root)
- stream.emit('root', stream.root, count)
count = 0;
stream.root = null;
}
diff --git a/readme.markdown b/readme.markdown
index 930e16e..658f11a 100644
--- a/readme.markdown
+++ b/readme.markdown
@@ -79,12 +79,6 @@ var stream = JSONStream.parse(['rows', true, 'doc']) //rows, ANYTHING, doc
stream.on('data', function(data) {
console.log('received:', data);
});
-
-stream.on('root', function(root, count) {
- if (!count) {
- console.log('no matches found:', root);
- }
-});
```
awesome!
diff --git a/test/multiple_objects_error.js b/test/multiple_objects_error.js
index 980423b..83d113b 100644
--- a/test/multiple_objects_error.js
+++ b/test/multiple_objects_error.js
@@ -8,14 +8,8 @@ var JSONStream = require('../');
var str = fs.readFileSync(file);
var server = net.createServer(function(client) {
- var root_calls = 0;
var data_calls = 0;
var parser = JSONStream.parse();
- parser.on('root', function(root, count) {
- ++ root_calls;
- it(root_calls).notEqual(2);
- });
-
parser.on('error', function(err) {
console.log(err);
server.close();
diff --git a/test/non_object_roots.js b/test/non_object_roots.js
deleted file mode 100644
index 8055ad6..0000000
--- a/test/non_object_roots.js
+++ /dev/null
@@ -1,16 +0,0 @@
-var JSONStream = require('../');
-var it = require('it-is');
-var parser = JSONStream.parse();
-
-var succeeded = false;
-
-parser.on('root', function (value) {
- it(value).equal(true);
- succeeded = true;
-});
-
-parser.on('end', function() {
- it(succeeded).equal(true);
-});
-
-parser.end('true');
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-jsonstream.git
More information about the Pkg-javascript-commits
mailing list