[Pkg-javascript-commits] [node-module-deps] 424/444: use cached-path-relative from https://github.com/substack/module-deps/pull/114

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:48:19 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 9c742e119ee75a692923e19b64aabc266d22d653
Author: substack <substack at 9nTgtYmvW4HID6ayt6Icwc8WZxdifx5SlSKKIX/X/1g=.ed25519>
Date:   Sat Oct 22 14:47:03 2016 -0400

    use cached-path-relative from https://github.com/substack/module-deps/pull/114
---
 index.js     | 5 +++--
 package.json | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 4047e4e..963e214 100644
--- a/index.js
+++ b/index.js
@@ -1,5 +1,6 @@
 var fs = require('fs');
 var path = require('path');
+var relativePath = require('cached-path-relative')
 
 var browserResolve = require('browser-resolve');
 var nodeResolve = require('resolve');
@@ -71,11 +72,11 @@ function Deps (opts) {
 
 Deps.prototype._isTopLevel = function (file) {
     var isTopLevel = this.entries.some(function (main) {
-        var m = path.relative(path.dirname(main), file);
+        var m = relativePath(path.dirname(main), file);
         return m.split(/[\\\/]/).indexOf('node_modules') < 0;
     });
     if (!isTopLevel) {
-        var m = path.relative(this.basedir, file);
+        var m = relativePath(this.basedir, file);
         isTopLevel = m.split(/[\\\/]/).indexOf('node_modules') < 0;
     }
     return isTopLevel;
diff --git a/package.json b/package.json
index c94ef01..a7fecfb 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,7 @@
   "dependencies": {
     "JSONStream": "^1.0.3",
     "browser-resolve": "^1.7.0",
+    "cached-path-relative": "^1.0.0",
     "concat-stream": "~1.5.0",
     "defined": "^1.0.0",
     "detective": "^4.0.0",

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