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

clia

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clia - npm Package Compare versions

Comparing version 2020.8.9 to 2020.8.10

5

CHANGELOG.md

@@ -0,1 +1,6 @@

### 2020.8.10
* empty or non-string inputs are ignored.
* trim spaces around inputs
### 2020.8.9

@@ -2,0 +7,0 @@

11

index.js

@@ -83,10 +83,15 @@ const parse_arg = (arg) => {

const trim_filter = (input) => input
.filter(a => typeof a === 'string')
.map(s => s.trim())
.filter(s => s.length)
module.exports = (args = [], alias = []) => {
if(!Array.isArray(args) || !Array.isArray(alias))
if (!Array.isArray(args) || !Array.isArray(alias))
throw Error(`expected input to be array(s). Eg clia(process.argv.slice(2),['alias','names'])`)
const parsed = combine_input(args)
const parsed = combine_input(trim_filter(args))
copy_alias_values(parsed, alias)
copy_alias_values(parsed, trim_filter(alias))

@@ -93,0 +98,0 @@ return {

{
"name": "clia",
"version": "2020.8.9",
"version": "2020.8.10",
"description": "Command line parser and t3st example project",

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

@@ -18,3 +18,3 @@ # clia

const conf = clia(process.argv.slice(2)) // in your app
const conf = clia(process.argv.slice(2))

@@ -37,6 +37,8 @@ // test in your browser on: https://npm.runkit.com/clia

## parsing
## edge cases
If `--` is encountered, it is ignored. All subsequent inputs are treated as arguments.
Empty or non-string inputs are ignored. Spaces are trimmed from inputs.
When `--` is encountered, it is ignored. All subsequent inputs are treated as arguments even if they start with `-`.
An error is thrown when:

@@ -43,0 +45,0 @@ * any argument containts `__proto__` *to prevent prototype pollution*

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