[Pkg-javascript-commits] [node-module-deps] 252/444: updated cycle test, default to entry
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:48:01 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-module-deps.
commit 07e3f09f93a98fe36ddac2cea586e92778f70a75
Author: James Halliday <mail at substack.net>
Date: Sun Jul 20 03:27:57 2014 -0700
updated cycle test, default to entry
---
index.js | 5 ++++-
test/cycle.js | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/index.js b/index.js
index 0557c54..4e860e0 100644
--- a/index.js
+++ b/index.js
@@ -49,7 +49,10 @@ function Deps (opts) {
Deps.prototype._transform = function (row, enc, next) {
var self = this;
self.pending ++;
- if (row.entry) self.entries.push(row.file);
+ if (typeof row === 'string') {
+ row = { file: row };
+ }
+ if (row.entry !== false) self.entries.push(row.file);
self.lookupPackage(row.file, function (err, pkg) {
if (err) return self.emit('error', err)
diff --git a/test/cycle.js b/test/cycle.js
index 20e8087..3efdca6 100644
--- a/test/cycle.js
+++ b/test/cycle.js
@@ -6,7 +6,8 @@ var concat = require('concat-stream');
test('cycle', function (t) {
t.plan(1);
- var p = mdeps(__dirname + '/cycle/main.js');
+ var p = mdeps();
+ p.end(__dirname + '/cycle/main.js');
var pack = packer();
p.pipe(JSONStream.stringify()).pipe(pack).pipe(concat(function (src) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git
More information about the Pkg-javascript-commits
mailing list