diff options
Diffstat (limited to 'lib/utils/location.js')
-rw-r--r-- | lib/utils/location.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/utils/location.js b/lib/utils/location.js index 94d9b2a..84a71ad 100644 --- a/lib/utils/location.js +++ b/lib/utils/location.js @@ -83,7 +83,20 @@ function relativeForFile(baseFile, file) { return relative(path.dirname(baseFile), file); } +/** + Compare two paths, return true if they are identical + ('README.md', './README.md') -> true + + @param {String} p1: first path + @param {String} p2: second path + @return {Boolean} +*/ +function areIdenticalPaths(p1, p2) { + return normalize(p1) === normalize(p2); +} + module.exports = { + areIdenticalPaths: areIdenticalPaths, isExternal: isExternal, isRelative: isRelative, isAnchor: isAnchor, |