Comparing version 3.0.4 to 3.0.5
@@ -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) |
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
31112
689
7