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 1.0.7 to 1.0.8

33

lib/nopt.js
// info about each config option.
var debug = process.env.DEBUG_NOPT
var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
? function () { console.error.apply(console, arguments) }

@@ -260,2 +260,3 @@ : function () {}

val = JSON.parse(la)
la = null
if (no) val = !val

@@ -265,2 +266,25 @@ i ++

// also support "foo":[Boolean, "bar"] and "--foo bar"
if (Array.isArray(types[arg]) && la) {
if (~types[arg].indexOf(la)) {
// an explicit type
val = la
i ++
} else if ( la === "null" && ~types[arg].indexOf(null) ) {
// null allowed
val = null
i ++
} else if ( !la.match(/^-{2,}[^-]/) &&
!isNaN(la) &&
~types[arg].indexOf(Number) ) {
// number
val = +la
i ++
} else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) {
// string
val = la
i ++
}
}
if (isArray) (data[arg] = data[arg] || []).push(val)

@@ -325,3 +349,3 @@ else data[arg] = val

var assert = require("assert")
, sys = require("sys")
, util = require("util")

@@ -471,2 +495,5 @@ , shorthands =

,[]]
,["--color always"
,{color:"always"}
,[]]
].forEach(function (test) {

@@ -479,3 +506,3 @@ var argv = test[0].split(/\s+/)

delete actual.argv
console.log(sys.inspect(actual, false, 2, true), parsed.remain)
console.log(util.inspect(actual, false, 2, true), parsed.remain)
for (var i in opts) {

@@ -482,0 +509,0 @@ var e = JSON.stringify(opts[i])

2

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

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

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