Socket
Socket
Sign inDemoInstall

@jhanssen/options

Package Overview
Dependencies
3
Maintainers
2
Versions
42
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 3.0.0

1

dist/index.d.ts

@@ -13,2 +13,3 @@ import minimist from "minimist";

export interface Options {
readonly prefix: string;
(name: string): Value | undefined;

@@ -15,0 +16,0 @@ (name: string, defaultValue: Value): Value;

12

dist/index.js

@@ -201,5 +201,5 @@ import fs from "fs";

}
const options = new Engine(optionsOptions, argv);
const engine = new Engine(optionsOptions, argv);
function value(name, defaultValue) {
const val = options.value(name);
const val = engine.value(name);
if (val === undefined)

@@ -210,3 +210,3 @@ return defaultValue;

function float(name, defaultValue) {
const v = parseFloat(options.string(name) || "");
const v = parseFloat(engine.string(name) || "");
if (typeof v === "number" && !isNaN(v))

@@ -217,3 +217,3 @@ return v;

function int(name, defaultValue) {
const v = parseInt(options.string(name) || "");
const v = parseInt(engine.string(name) || "");
if (typeof v === "number" && !isNaN(v))

@@ -224,3 +224,3 @@ return v;

function json(name, defaultValue) {
const opt = options.value(name);
const opt = engine.value(name);
if (opt === undefined)

@@ -239,3 +239,3 @@ return defaultValue;

function string(name, defaultValue) {
return options.string(name) ?? defaultValue;
return engine.string(name) ?? defaultValue;
}

@@ -242,0 +242,0 @@ return Object.assign(value, {

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

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

Sorry, the diff of this file is not supported yet

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