Socket
Socket
Sign inDemoInstall

is-path-global

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-path-global - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

13

index.js
'use strict';
const path = require('path');
const isPathInside = require('is-path-inside');
var delimiter = require('path').delimiter;
var isPathInside = require('is-path-inside');
module.exports = function (str) {
module.exports = str => {
if (typeof str !== 'string') {
throw new TypeError('Expected a string');
throw new TypeError(`Expected a \`string\`, got \`${typeof str}\``);
}
return process.env.PATH.split(delimiter).some(function (path) {
return isPathInside(str, path) || str === path;
});
return process.env.PATH.split(path.delimiter).some(pth => isPathInside(str, pth) || str === pth);
};
{
"name": "is-path-global",
"version": "1.0.2",
"version": "2.0.0",
"description": "Check if a path is in PATH",

@@ -13,6 +13,6 @@ "license": "MIT",

"engines": {
"node": ">=0.10.0"
"node": ">=4"
},
"scripts": {
"test": "node test.js"
"test": "xo && ava"
},

@@ -37,4 +37,8 @@ "files": [

"devDependencies": {
"ava": "^0.0.4"
"ava": "*",
"xo": "*"
},
"xo": {
"esnext": true
}
}

@@ -16,3 +16,3 @@ # is-path-global [![Build Status](https://travis-ci.org/kevva/is-path-global.svg?branch=master)](https://travis-ci.org/kevva/is-path-global)

```js
var isPathGlobal = require('is-path-global');
const isPathGlobal = require('is-path-global');

@@ -19,0 +19,0 @@ isPathGlobal('/bin/sh');

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