Comparing version 3.0.1 to 3.0.2
17
index.js
'use strict'; | ||
var isObject = require('isobject'); | ||
var path = require('path'); | ||
@@ -42,4 +43,4 @@ var fs = require('fs'); | ||
a = normalize(a); | ||
b = normalize(b); | ||
a = unixify(a); | ||
b = unixify(b); | ||
@@ -72,4 +73,4 @@ // if `a` had a slash, add it back | ||
relative.toBase = function toBase(base, fp) { | ||
base = normalize(base); | ||
fp = normalize(fp); | ||
base = unixify(base); | ||
fp = unixify(fp); | ||
@@ -84,3 +85,3 @@ var res = fp.slice(base.length); | ||
/** | ||
* Normalize slashes in paths. This is necessary b/c | ||
* Normalize slashes in paths to unix slashes. This is necessary since | ||
* paths are not calculated the same by node.js when | ||
@@ -90,3 +91,3 @@ * windows paths are used. | ||
function normalize(str) { | ||
function unixify(str) { | ||
return str.replace(/[\\\/]+/g, '/'); | ||
@@ -145,3 +146,3 @@ } | ||
if (stat != null && typeof stat === 'object') { | ||
if (isObject(stat) && typeof stat.isDirectory === 'function') { | ||
return stat.isDirectory(); | ||
@@ -168,2 +169,2 @@ } | ||
return !isDir(fp, stat); | ||
} | ||
} |
{ | ||
"name": "relative", | ||
"description": "Get the relative filepath from path A to path B. Calculates from file-to-directory, file-to-file, directory-to-file, and directory-to-directory.", | ||
"version": "3.0.1", | ||
"author": { | ||
"name": "Jon Schlinkert", | ||
"url": "https://github.com/jonschlinkert" | ||
}, | ||
"version": "3.0.2", | ||
"homepage": "https://github.com/jonschlinkert/relative", | ||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"repository": "jonschlinkert/relative", | ||
@@ -24,5 +22,8 @@ "bugs": { | ||
}, | ||
"dependencies": { | ||
"isobject": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.1.0", | ||
"should": "^5.0.0" | ||
"mocha": "*", | ||
"should": "*" | ||
}, | ||
@@ -40,3 +41,15 @@ "keywords": [ | ||
"resolve" | ||
] | ||
} | ||
], | ||
"verb": { | ||
"related": { | ||
"list": [ | ||
"cwd", | ||
"export-files", | ||
"is-absolute", | ||
"is-relative", | ||
"is-dotfile", | ||
"global-prefix" | ||
] | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
8755
130
0
1
+ Addedisobject@^2.0.0
+ Addedisarray@1.0.0(transitive)
+ Addedisobject@2.1.0(transitive)