Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

path-is-same

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

path-is-same - npm Package Compare versions

Comparing version 1.0.11 to 1.0.12

11

CHANGELOG.md

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

3

index.d.ts

@@ -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;
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc