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

is-path-inside

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-path-inside - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

23

index.js

@@ -5,18 +5,9 @@ 'use strict';

module.exports = (childPath, parentPath) => {
childPath = path.resolve(childPath);
parentPath = path.resolve(parentPath);
if (process.platform === 'win32') {
childPath = childPath.toLowerCase();
parentPath = parentPath.toLowerCase();
}
if (childPath === parentPath) {
return false;
}
childPath += path.sep;
parentPath += path.sep;
return childPath.startsWith(parentPath);
const relation = path.relative(parentPath, childPath);
return Boolean(
relation &&
relation !== '..' &&
!relation.startsWith(`..${path.sep}`) &&
relation !== path.resolve(childPath)
);
};
{
"name": "is-path-inside",
"version": "3.0.2",
"version": "3.0.3",
"description": "Check if a path is inside another path",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -1,2 +0,2 @@

# is-path-inside [![Build Status](https://travis-ci.org/sindresorhus/is-path-inside.svg?branch=master)](https://travis-ci.org/sindresorhus/is-path-inside)
# is-path-inside

@@ -3,0 +3,0 @@ > Check if a path is inside another path

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