[Pkg-javascript-commits] [node-deps-sort] 30/79: put indexes back
Bastien Roucariès
rouca at moszumanska.debian.org
Wed Sep 6 09:41:54 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-deps-sort.
commit 66b03dd7bf6372b0b267906966930684109bff6e
Author: James Halliday <mail at substack.net>
Date: Mon Jul 21 07:37:21 2014 -0700
put indexes back
---
index.js | 5 +----
test/dedupe.js | 9 +++++----
test/dedupe_index.js | 2 +-
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/index.js b/index.js
index 55e8060..ce63202 100644
--- a/index.js
+++ b/index.js
@@ -27,7 +27,7 @@ function sorter (rows, tr, opts) {
var hashes = {}, deduped = {};
if (opts.dedupe) {
- rows.forEach(function (row, ix) {
+ rows.forEach(function (row) {
var h = shasum(row.source);
if (hashes[h]) {
row.dedupe = hashes[h];
@@ -59,9 +59,6 @@ function sorter (rows, tr, opts) {
row.indexDeps = {};
Object.keys(row.deps).forEach(function (key) {
var id = row.deps[key];
- if (has(deduped, id)) {
- id = deduped[id];
- }
row.indexDeps[key] = index[id];
});
if (row.dedupe) {
diff --git a/test/dedupe.js b/test/dedupe.js
index f9933bd..e1806fc 100644
--- a/test/dedupe.js
+++ b/test/dedupe.js
@@ -11,10 +11,11 @@ test('dedupe', function (t) {
t.deepEqual(rows, [
{ id: '/bar.js', deps: {}, source: 'TWO' },
{ id: '/foo.js', deps: {}, source: 'TWO', dedupe: '/bar.js' },
- { id: '/main.js', deps: {
- './foo': '/foo.js',
- './bar': '/bar.js'
- }, source: 'ONE' }
+ {
+ id: '/main.js',
+ deps: { './foo': '/foo.js', './bar': '/bar.js' },
+ source: 'ONE'
+ }
]);
}
s.pipe(through.obj(write, end));
diff --git a/test/dedupe_index.js b/test/dedupe_index.js
index 8e87855..fb6348a 100644
--- a/test/dedupe_index.js
+++ b/test/dedupe_index.js
@@ -30,7 +30,7 @@ test('dedupe index', function (t) {
deps: { './foo': '/foo.js', './bar': '/bar.js' },
source: 'ONE',
index: 3,
- indexDeps: { './foo': 1, './bar': 1 },
+ indexDeps: { './foo': 2, './bar': 1 },
}
]);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-deps-sort.git
More information about the Pkg-javascript-commits
mailing list