[Pkg-javascript-commits] [node-module-deps] 247/444: windows: fix path splitting
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:48:00 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 42ceedddef9926e216e649f1a224b945569182a0
Author: Chris Dickinson <christopher.s.dickinson at gmail.com>
Date: Mon Jul 7 18:14:15 2014 -0700
windows: fix path splitting
---
index.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/index.js b/index.js
index c9c4b43..fd75033 100644
--- a/index.js
+++ b/index.js
@@ -168,7 +168,7 @@ Deps.prototype.getTransforms = function (file, pkg) {
var self = this;
var isTopLevel = this.entries.some(function (main) {
var m = path.relative(path.dirname(main), file);
- return m.split('/').indexOf('node_modules') < 0;
+ return m.split(/[\\\/]/).indexOf('node_modules') < 0;
});
var transforms = [].concat(isTopLevel ? this.transforms : [])
@@ -359,7 +359,7 @@ Deps.prototype.lookupPackage = function (file, cb) {
return cb(null, undefined);
}
var dir = dirs.shift();
- if (dir.split('/').slice(-1)[0] === 'node_modules') {
+ if (dir.split(/[\\\/]/).slice(-1)[0] === 'node_modules') {
return cb(null, undefined);
}
--
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