[Pkg-javascript-commits] [node-module-deps] 259/444: include "file" property in the rows
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 940784c26daa8feaea284667def5d35a20cb7b83
Author: James Halliday <mail at substack.net>
Date: Sun Jul 20 05:20:18 2014 -0700
include "file" property in the rows
---
index.js | 2 +-
test/deps.js | 3 +++
test/expose.js | 2 ++
test/noparse.js | 2 ++
test/source.js | 4 ++++
test/unicode.js | 3 +++
6 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/index.js b/index.js
index 3384cac..96b5a79 100644
--- a/index.js
+++ b/index.js
@@ -227,7 +227,6 @@ Deps.prototype.walk = function (id, parent, cb) {
rec = copy(id);
if (rec.entry === false) delete rec.entry;
id = rec.file;
- delete rec.file;
}
self.resolve(id, parent, function (err, file, pkg) {
@@ -280,6 +279,7 @@ Deps.prototype.walk = function (id, parent, cb) {
if (!rec.id) rec.id = file;
if (!rec.source) rec.source = src;
if (!rec.deps) rec.deps = resolved;
+ if (!rec.file) rec.file = file;
if (self.entries.indexOf(file) >= 0) {
rec.entry = true;
diff --git a/test/deps.js b/test/deps.js
index f761e50..284d8d2 100644
--- a/test/deps.js
+++ b/test/deps.js
@@ -24,17 +24,20 @@ test('deps', function (t) {
t.same(rows.sort(cmp), [
{
id: files.main,
+ file: files.main,
source: sources.main,
entry: true,
deps: { './foo': files.foo }
},
{
id: files.foo,
+ file: files.foo,
source: sources.foo,
deps: { './bar': files.bar }
},
{
id: files.bar,
+ file: files.bar,
source: sources.bar,
deps: {}
}
diff --git a/test/expose.js b/test/expose.js
index 0be9e37..2bd8027 100644
--- a/test/expose.js
+++ b/test/expose.js
@@ -23,11 +23,13 @@ test('single id export', function (t) {
t.same(rows.sort(cmp), [
{
id: 'foo',
+ file: files.foo,
source: sources.foo,
deps: { './bar': files.bar }
},
{
id: files.bar,
+ file: files.bar,
source: sources.bar,
deps: {}
}
diff --git a/test/noparse.js b/test/noparse.js
index b3fbf19..9f2c9ee 100644
--- a/test/noparse.js
+++ b/test/noparse.js
@@ -24,12 +24,14 @@ test('noParse', function (t) {
t.deepEqual(rows.sort(cmp), [
{
id: files.main,
+ file: files.main,
source: sources.main,
entry: true,
deps: { './foo': files.foo }
},
{
id: files.foo,
+ file: files.foo,
source: sources.foo,
deps: {}
}
diff --git a/test/source.js b/test/source.js
index 2023323..4e3c167 100644
--- a/test/source.js
+++ b/test/source.js
@@ -30,22 +30,26 @@ test('source', function (t) {
t.same(rows.sort(cmp), [
{
id: files.main,
+ file: files.main,
source: sources.main,
entry: true,
deps: { './foo': files.foo, './extra.js': files.extra }
},
{
id: files.foo,
+ file: files.foo,
source: sources.foo,
deps: { './bar': files.bar }
},
{
id: files.bar,
+ file: files.bar,
source: sources.bar,
deps: {}
},
{
id: files.extra,
+ file: files.extra,
source: sources.extra,
deps: {}
},
diff --git a/test/unicode.js b/test/unicode.js
index 1b8aab1..f4add9d 100644
--- a/test/unicode.js
+++ b/test/unicode.js
@@ -24,17 +24,20 @@ test('unicode deps', function (t) {
t.same(rows.sort(cmp), [
{
id: files.main,
+ file: files.main,
source: sources.main,
entry: true,
deps: { './foo': files.foo }
},
{
id: files.foo,
+ file: files.foo,
source: sources.foo,
deps: { './bar': files.bar }
},
{
id: files.bar,
+ file: files.bar,
source: sources.bar,
deps: {}
}
--
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