[Pkg-javascript-commits] [node-browser-pack] 19/141: use .queue() from through

Bastien Roucariès rouca at moszumanska.debian.org
Thu May 4 10:23:21 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-browser-pack.

commit a6afbcececac1868d9a8dfc7d33944ca71157d1d
Author: James Halliday <mail at substack.net>
Date:   Thu Feb 21 00:33:11 2013 -0800

    use .queue() from through
---
 index.js     | 10 +++++-----
 package.json |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/index.js b/index.js
index 346e89e..18b9527 100644
--- a/index.js
+++ b/index.js
@@ -32,9 +32,9 @@ module.exports = function (opts) {
     return duplexer(parser, output);
     
     function write (row) {
-        if (first) output.emit('data', prelude);
+        if (first) this.queue(prelude);
         
-        this.emit('data', [
+        this.queue([
             (first ? '' : ','),
             JSON.stringify(row.id),
             ':[',
@@ -52,9 +52,9 @@ module.exports = function (opts) {
     }
     
     function end () {
-        if (first) output.emit('data', prelude);
+        if (first) this.queue(prelude);
         
-        this.emit('data', '},{},' + JSON.stringify(entries) + ')');
-        this.emit('end');
+        this.queue('},{},' + JSON.stringify(entries) + ')');
+        this.queue(null);
     }
 };
diff --git a/package.json b/package.json
index 6f6a2c4..3d20195 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
     "name": "browser-pack",
-    "version": "0.2.0",
+    "version": "0.2.1",
     "description": "pack node-style source files from a json stream into a browser bundle",
     "main": "index.js",
     "bin": {
@@ -9,7 +9,7 @@
     "dependencies": {
         "JSONStream": "~0.4.3",
         "duplexer": "~0.0.3",
-        "through": "~2.1.0"
+        "through": "~2.2.0"
     },
     "devDependencies": {
         "tap": "~0.4.0",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-browser-pack.git



More information about the Pkg-javascript-commits mailing list