Socket
Socket
Sign inDemoInstall

which

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

which - npm Package Compare versions

Comparing version 1.2.4 to 1.2.5

CHANGELOG.md

12

package.json

@@ -5,3 +5,3 @@ {

"description": "Like which(1) unix command. Find the first instance of an executable in the PATH.",
"version": "1.2.4",
"version": "1.2.5",
"repository": {

@@ -24,4 +24,10 @@ "type": "git",

"scripts": {
"test": "tap test/*.js --cov"
}
"test": "tap test/*.js --cov",
"changelog": "bash changelog.sh",
"postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}"
},
"files": [
"which.js",
"bin/which"
]
}

@@ -14,3 +14,10 @@ module.exports = which

function getPathInfo(cmd, opt) {
function getNotFoundError (cmd) {
var er = new Error('not found: ' + cmd)
er.code = 'ENOENT'
return er
}
function getPathInfo (cmd, opt) {
var colon = opt.colon || COLON

@@ -35,5 +42,5 @@ var pathEnv = opt.path || process.env.Path || process.env.PATH || ''

// If it's absolute, then we don't bother searching the pathenv.
// If it has a slash, then we don't bother searching the pathenv.
// just check the file itself, and that's it.
if (isAbsolute(cmd))
if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
pathEnv = ['']

@@ -65,3 +72,3 @@

else
return cb(new Error('not found: '+cmd))
return cb(getNotFoundError(cmd))
}

@@ -73,3 +80,6 @@

var p = path.resolve(pathPart, cmd)
var p = path.join(pathPart, cmd)
if (!pathPart && (/^\./).test(cmd)) {
p = cmd.slice(0, 2) + p
}
;(function E (ii, ll) {

@@ -106,2 +116,5 @@ if (ii === ll) return F(i + 1, l)

var p = path.join(pathPart, cmd)
if (!pathPart && (/^\./).test(cmd)) {
p = cmd.slice(0, 2) + p
}
for (var j = 0, ll = pathExt.length; j < ll; j ++) {

@@ -125,3 +138,3 @@ var cur = p + pathExt[j]

throw new Error('not found: '+cmd)
throw getNotFoundError(cmd)
}
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