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

realize-package-specifier

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

realize-package-specifier - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

README.md~

1

index.js

@@ -17,2 +17,3 @@ "use strict"

}
if ((dep.type == "range" || dep.type == "version") && dep.name != dep.raw) return cb(null, dep)
var specpath = dep.type == "local"

@@ -19,0 +20,0 @@ ? path.resolve(where, dep.spec)

2

package.json
{
"name": "realize-package-specifier",
"version": "1.2.0",
"version": "1.3.0",
"description": "Like npm-package-arg, but more so, producing full file paths and differentiating local tar and directory sources.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -7,11 +7,13 @@ "use strict"

var re = {
tarball: /[\/\\]a.tar.gz$/,
packagedir: /[\/\\]b$/,
packagejson: /[\/\\]b[\/\\]package.json$/,
nonpackagedir: /[\/\\]c$/,
nopackagejson: /[\/\\]c[\/\\]package.json$/,
remotename: /[\/\\]d$/,
packagedirlikegithub: /[\/\\]e[\/\\]1$/,
packagejsonlikegithub: /[\/\\]e[\/\\]1[\/\\]package.json$/,
github: /[\/\\]e[\/\\]2$/
tarball: /[/\\]a.tar.gz$/,
packagedir: /[/\\]b$/,
packagejson: /[/\\]b[/\\]package.json$/,
nonpackagedir: /[/\\]c$/,
nopackagejson: /[/\\]c[/\\]package.json$/,
remotename: /[/\\]d$/,
packagedirlikegithub: /[/\\]e[/\\]1$/,
packagejsonlikegithub: /[/\\]e[/\\]1[/\\]package.json$/,
github: /[/\\]e[/\\]2$/,
localrangefile: /[/\\]1[.]0[.]0$/,
localverfile: /[/\\]1$/
}

@@ -49,2 +51,8 @@

}
else if (re.localverfile.test(path)) {
callback(null,{isDirectory:function(){ return false }})
}
else if (re.localrangefile.test(path)) {
callback(null,{isDirectory:function(){ return false }})
}
else {

@@ -58,3 +66,3 @@ throw new Error("Unknown stat fixture path: "+path)

test("realize-package-specifier", function (t) {
t.plan(10)
t.plan(12)
rps("a.tar.gz", function (err, result) {

@@ -90,5 +98,11 @@ t.is(result.type, "local", "local tarball")

})
rps("1", function (err, result) {
t.is(result.type, "local", "range like local file is still a local file")
})
rps("1.0.0", function (err, result) {
t.is(result.type, "local", "version like local file is still a local file")
})
})
test("named realize-package-specifier", function (t) {
t.plan(10)
t.plan(12)

@@ -125,2 +139,8 @@ rps("a@a.tar.gz", function (err, result) {

})
rps("e@1", function (err, result) {
t.is(result.type, "range", "range like specifier is never a local file")
})
rps("e@1.0.0", function (err, result) {
t.is(result.type, "version", "version like specifier is never a local file")
})
})
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