🚷 Check that two directories resolve to the same path.
is-same-path is a simple function to check if two paths resolve to the same path.
Simply type:
npm install --save is-same-path
const isSamePath = require('is-same-path');
const paths = ['./.././//file', '../file'];
console.log(isSamePath(...paths)); // "true"
Check if two paths with different notation are the same when resolved.
path1
: A file system path as aString
.path2
: A second file system path as aString
.- Return:
true
if both path resolve to the same path.
This module and the whole directory is subject to the MIT license.
I usually prefer the GPL license, but I don’t think it’s big enough care for that (and scare people like you).
Copyright (c) 2017 Etienne Prud’homme