[Pkg-javascript-commits] [node-deps-sort] 08/79: add one to the index to prevent falsy compares in browser-pack's require logic

Bastien Roucariès rouca at moszumanska.debian.org
Wed Sep 6 09:41:52 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 917cc0b46a3f42205ce7ef6f2d3c91517baf1c97
Author: James Halliday <mail at substack.net>
Date:   Tue Jul 9 01:05:21 2013 -0700

    add one to the index to prevent falsy compares in browser-pack's require logic
---
 index.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/index.js b/index.js
index 003342b..60efa8c 100644
--- a/index.js
+++ b/index.js
@@ -15,10 +15,10 @@ module.exports = function (opts) {
         if (opts.index) {
             var index = {};
             rows.forEach(function (row, ix) {
-                row.index = ix;
-                index[row.id] = ix;
+                row.index = ix + 1;
+                index[row.id] = ix + 1;
             });
-            rows.forEach(function (row, ix) {
+            rows.forEach(function (row) {
                 row.indexDeps = {};
                 Object.keys(row.deps).forEach(function (key) {
                     row.indexDeps[key] = index[row.deps[key]];

-- 
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