Socket
Socket
Sign inDemoInstall

@jhanssen/options

Package Overview
Dependencies
3
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.7 to 1.0.8

23

index.js

@@ -39,2 +39,18 @@ /*global require,module,process*/

function realValue(v)
{
if (typeof v !== "string")
return v;
const vf = parseFloat(v);
if (!isNaN(vf))
return vf;
switch (v) {
case "true":
return true;
case "false":
return false;
}
return v;
}
class Options {

@@ -54,3 +70,3 @@ constructor(prefix, argv) {

if (envname in process.env)
return process.env[envname];
return realValue(process.env[envname]);
return undefined;

@@ -118,3 +134,6 @@ }

let ret = function(name, defaultValue) {
return data.options.value(name) || defaultValue;
const val = data.options.value(name);
if (typeof val === "undefined")
return defaultValue;
return val;
};

@@ -121,0 +140,0 @@ ret.int = function(name, defaultValue) {

2

package.json
{
"name": "@jhanssen/options",
"version": "1.0.7",
"version": "1.0.8",
"description": "Options parser that looks at argv, environment variables and a config file.",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc