Socket
Socket
Sign inDemoInstall

optionator

Package Overview
Dependencies
6
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.0 to 0.4.0

14

lib/index.js
// Generated by LiveScript 1.2.0
(function(){
var VERSION, ref$, id, map, compact, any, groupBy, chars, isItNaN, keys, Obj, camelize, deepIs, closestString, nameToRaw, dasherize, generateHelp, generateHelpForOption, parsedTypeCheck, parseType, parseLevn, camelizeKeys, parseString, main, toString$ = {}.toString, slice$ = [].slice;
VERSION = '0.3.0';
VERSION = '0.4.0';
ref$ = require('prelude-ls'), id = ref$.id, map = ref$.map, compact = ref$.compact, any = ref$.any, groupBy = ref$.groupBy, chars = ref$.chars, isItNaN = ref$.isItNaN, keys = ref$.keys, Obj = ref$.Obj, camelize = ref$.camelize;

@@ -149,3 +149,3 @@ deepIs = require('deep-is');

setValue = function(name, value){
var opt, val, e;
var opt, val, e, currentType;
opt = getOption(name);

@@ -167,5 +167,8 @@ if (opt.boolean) {

}
currentType = toString$.call(obj[name]).slice(8, -1);
if (obj[name] != null) {
if (libOptions.concatRepeatedArrays && toString$.call(obj[name]).slice(8, -1) === 'Array') {
if (libOptions.concatRepeatedArrays && currentType === 'Array') {
obj[name] = obj[name].concat(val);
} else if (libOptions.mergeRepeatedObjects && currentType === 'Object') {
import$(obj[name], val);
} else {

@@ -402,2 +405,7 @@ obj[name] = val;

module.exports = main;
function import$(obj, src){
var own = {}.hasOwnProperty;
for (var key in src) if (own.call(src, key)) obj[key] = src[key];
return obj;
}
}).call(this);
{
"name": "optionator",
"version": "0.3.0",
"version": "0.4.0",
"author": "George Zahariev <z@georgezahariev.com>",

@@ -18,3 +18,3 @@ "description": "option parsing and help generation",

"type": "MIT",
"url": "https://raw.github.com/gkz/optionator/master/LICENSE"
"url": "https://raw.githubusercontent.com/gkz/optionator/master/LICENSE"
}

@@ -37,3 +37,3 @@ ],

"type-check": "~0.3.1",
"levn": "~0.2.4",
"levn": "~0.2.5",
"fast-levenshtein": "~1.0.0"

@@ -40,0 +40,0 @@ },

@@ -24,3 +24,3 @@ # Optionator

MIT license. Version 0.3.0
MIT license. Version 0.4.0

@@ -141,3 +141,4 @@ npm install optionator

mutuallyExclusive: Maybe [[String | [String]]],
concatRepeatedArrays: Maybe Boolean
concatRepeatedArrays: Maybe Boolean,
mergeRepeatedObjects: Maybe Boolean
}

@@ -152,2 +153,3 @@

* `concatRepeatedArrays` is an optional boolean (defaults to `false`) - when set to `true` and an option contains an array value and is repeated, the subsequent values for the flag will be appended rather than overwriting the original value - eg. option `g` of type `[String]`: `-g a -g b -g c,d` will result in `['a','b','c','d']`
* `mergeRepeatedObjects` is an optional boolean (defaults to `false`) - when set to `true` and an option contains an object value and is repeated, the subsequent values for the flag will be merged rather than overwriting the original value - eg. option `g` of type `Object`: `-g a:1 -g b:2 -g c:3,d:4` will result in `{a: 1, b: 2, c: 3, d: 4}`

@@ -154,0 +156,0 @@ #### Heading Properties

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