path-is-same
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -6,2 +6,13 @@ # Change Log | ||
## [1.0.12](https://github.com/bluelovers/ws-iconv/compare/path-is-same@1.0.11...path-is-same@1.0.12) (2021-08-13) | ||
### 🔖 Miscellaneous | ||
* fs-symlink ([856d8dc](https://github.com/bluelovers/ws-iconv/commit/856d8dc8d543a71833c92507fb844956623835f3)) | ||
## [1.0.11](https://github.com/bluelovers/ws-iconv/compare/path-is-same@1.0.10...path-is-same@1.0.11) (2021-07-23) | ||
@@ -8,0 +19,0 @@ |
@@ -1,3 +0,4 @@ | ||
export declare function fsSameRealpath(dir0: string, dir1: string): boolean; | ||
export declare function _pathIsSame(p1: string, p2: string): boolean; | ||
export declare function fsSameRealpath(p1: string, p2: string, ...ps: string[]): boolean; | ||
export declare function pathIsSame(p1: string, p2: string, ...ps: string[]): boolean; | ||
export default pathIsSame; |
36
index.js
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pathIsSame = exports.fsSameRealpath = void 0; | ||
const path_1 = require("path"); | ||
exports.pathIsSame = exports.fsSameRealpath = exports._pathIsSame = void 0; | ||
const upath2_1 = require("upath2"); | ||
const fs_1 = require("fs"); | ||
function fsSameRealpath(dir0, dir1) { | ||
try { | ||
let real01 = (0, fs_1.realpathSync)(dir0); | ||
let real02 = (0, fs_1.realpathSync)(dir1); | ||
return pathIsSame(real01, real02); | ||
function _pathIsSame(p1, p2) { | ||
return (0, upath2_1.relative)(p1, p2) === ''; | ||
} | ||
exports._pathIsSame = _pathIsSame; | ||
function fsSameRealpath(p1, p2, ...ps) { | ||
var _a; | ||
if (ps.length <= 0) { | ||
throw new TypeError(`p2 must be protected`); | ||
} | ||
catch (e) { | ||
if (!(p1 === null || p1 === void 0 ? void 0 : p1.length) || !((_a = ps[0]) === null || _a === void 0 ? void 0 : _a.length)) { | ||
return false; | ||
} | ||
p1 = (0, fs_1.realpathSync)(p1); | ||
return ps.every(p2 => { | ||
try { | ||
p2 = (0, fs_1.realpathSync)(p2); | ||
return _pathIsSame(p1, p2); | ||
} | ||
catch (e) { | ||
} | ||
return false; | ||
}); | ||
} | ||
exports.fsSameRealpath = fsSameRealpath; | ||
function pathIsSame(p1, ...ps) { | ||
var _a; | ||
if (ps.length <= 0) { | ||
throw new TypeError(`p2 must be protected`); | ||
} | ||
return ps.every(p2 => (0, path_1.relative)(p1, p2) === ''); | ||
if (!(p1 === null || p1 === void 0 ? void 0 : p1.length) || !((_a = ps[0]) === null || _a === void 0 ? void 0 : _a.length)) { | ||
return false; | ||
} | ||
return ps.every(p2 => _pathIsSame(p1, p2)); | ||
} | ||
@@ -22,0 +40,0 @@ exports.pathIsSame = pathIsSame; |
{ | ||
"name": "path-is-same", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "", | ||
@@ -33,5 +33,6 @@ "homepage": "https://github.com/bluelovers/ws-iconv/tree/master/packages/path-is-same#readme", | ||
"dependencies": { | ||
"tslib": "^2.3.0" | ||
"tslib": "^2.3.0", | ||
"upath2": "^3.1.9" | ||
}, | ||
"gitHead": "cff5b85bc0fa0d4f592c3ef98b7da964f4770b61" | ||
"gitHead": "008b0ff206ac188acd641377c3a6e4fb3a73acbe" | ||
} |
Sorry, the diff of this file is not supported yet
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
9363
45
2
+ Addedupath2@^3.1.9
+ Added@types/node@22.10.2(transitive)
+ Addedpath-is-network-drive@1.0.21(transitive)
+ Addedpath-strip-sep@1.0.18(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedupath2@3.1.20(transitive)