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

nopt

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nopt - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

5

lib/nopt.js

@@ -129,2 +129,7 @@ // info about each config option.

if (val === true) return false
val = String(val)
var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//
if (val.match(homePattern) && process.env.HOME) {
val = path.resolve(process.env.HOME, val.substr(2))
}
data[k] = path.resolve(String(val))

@@ -131,0 +136,0 @@ return true

2

package.json
{
"name": "nopt",
"version": "2.2.0",
"version": "2.2.1",
"description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",

@@ -5,0 +5,0 @@ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",

@@ -18,2 +18,10 @@ var nopt = require("../")

test("~ path is resolved to $HOME", function (t) {
var path = require("path")
if (!process.env.HOME) process.env.HOME = "/tmp"
var parsed = nopt({key: path}, {}, ["--key=~/val"], 0)
t.same(parsed.key, path.resolve(process.env.HOME, "val"))
t.end()
})
test("other tests", function (t) {

@@ -20,0 +28,0 @@

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