Socket
Socket
Sign inDemoInstall

nopt

Package Overview
Dependencies
Maintainers
3
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 3.0.4 to 3.0.5

5

lib/nopt.js

@@ -210,3 +210,6 @@ // info about each config option.

var t = typeDefs[types[i]]
if (t && type === t.type) {
if (t && ((type.name && t.type.name) ?
(type.name === t.type.name) :
(type === t.type))
) {
var d = {}

@@ -213,0 +216,0 @@ ok = false !== t.validate(d, k, val)

7

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

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

},
"repository": "http://github.com/isaacs/nopt",
"repository": {
"type": "git",
"url": "https://github.com/npm/nopt.git"
},
"bin": "./bin/nopt.js",

@@ -13,0 +16,0 @@ "license": "ISC",

@@ -34,2 +34,17 @@ var nopt = require("../")

// https://github.com/npm/nopt/issues/48
test("Check types based on name of type", function (t) {
var parsed = nopt({"parse-me": {name: "Number"}}, null, ['--parse-me=1.20'], 0)
t.equal(parsed['parse-me'], 1.2)
t.end()
})
test("Types passed without a name are not parsed", function (t) {
var parsed = nopt({"parse-me": {}}, null, ['--parse-me=1.20'], 0)
//should only contain argv
t.equal(Object.keys(parsed).length, 1)
t.end()
})
test("other tests", function (t) {

@@ -36,0 +51,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