Socket
Socket
Sign inDemoInstall

npm-package-arg

Package Overview
Dependencies
Maintainers
4
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-package-arg - npm Package Compare versions

Comparing version 5.1.2 to 6.0.0

15

npa.js

@@ -21,2 +21,11 @@ 'use strict'

let spec
if (typeof arg === 'object') {
if (arg instanceof Result && (!where || where === arg.where)) {
return arg
} else if (arg.name && arg.rawSpec) {
return npa.resolve(arg.name, arg.rawSpec, where || arg.where)
} else {
return npa(arg.raw, where || arg.where)
}
}
const nameEndsAt = arg[0] === '@' ? arg.slice(1).indexOf('@') + 1 : arg.indexOf('@')

@@ -135,6 +144,4 @@ const namePart = nameEndsAt > 0 ? arg.slice(0, nameEndsAt) : arg

res.gitCommittish = null
} else if (committish == null || committish === '') {
res.gitCommittish = 'master'
} else {
res.gitCommittish = committish
res.gitCommittish = committish === '' ? null : committish
}

@@ -209,3 +216,3 @@ return res

fetchSpec: matched[1],
gitCommittish: matched[2] || 'master'
gitCommittish: matched[2] == null ? null : matched[2]
}

@@ -212,0 +219,0 @@ }

{
"name": "npm-package-arg",
"version": "5.1.2",
"version": "6.0.0",
"description": "Parse the things that can be arguments to `npm install`",

@@ -13,5 +13,5 @@ "main": "npa.js",

"dependencies": {
"hosted-git-info": "^2.4.2",
"hosted-git-info": "^2.5.0",
"osenv": "^0.1.4",
"semver": "^5.1.0",
"semver": "^5.4.1",
"validate-npm-package-name": "^3.0.0"

@@ -18,0 +18,0 @@ },

# npm-package-arg
[![Build Status](https://travis-ci.org/npm/npm-package-arg.svg?branch=master)](https://travis-ci.org/npm/npm-package-arg)
Parses package name and specifier passed to commands like `npm install` or

@@ -4,0 +6,0 @@ `npm cache add`, or as found in `package.json` dependency sections.

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