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

optimist

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

optimist - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

test/whitespace.js

18

index.js

@@ -313,6 +313,5 @@ var path = require('path');

function setArg (key, val) {
var num = Number(val);
var value = typeof val !== 'string' || isNaN(num) ? val : num;
if (flags.strings[key]) value = val;
var value = !flags.strings[key] && isNumber(val)
? Number(val) : val
;
setKey(argv, key.split('.'), value);

@@ -407,4 +406,5 @@

else {
var n = Number(arg);
argv._.push(flags.strings['_'] || isNaN(n) ? arg : n);
argv._.push(
flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
);
}

@@ -495,1 +495,7 @@ }

}
function isNumber (x) {
if (typeof x === 'number') return true;
if (/^0x[0-9a-f]+$/i.test(x)) return true;
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
}
{
"name" : "optimist",
"version" : "0.5.1",
"version" : "0.5.2",
"description" : "Light-weight option parsing with an argv hash. No optstrings attached.",

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

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