New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@anycli/parser

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anycli/parser - npm Package Compare versions

Comparing version 3.0.4 to 3.1.0

8

CHANGELOG.md

@@ -0,1 +1,9 @@

<a name="3.1.0"></a>
# [3.1.0](https://github.com/anycli/parser/compare/b5a7d6d5e4df2f270a900f83e01b8ac7836cd556...v3.1.0) (2018-02-03)
### Features
* added env to flags ([56be8c8](https://github.com/anycli/parser/commit/56be8c8))
<a name="3.0.4"></a>

@@ -2,0 +10,0 @@ ## [3.0.4](https://github.com/anycli/parser/compare/6a33b0633c9e422b18ec33d9a1dd4202c97adf28...v3.0.4) (2018-02-01)

4

lib/flags.d.ts

@@ -14,2 +14,6 @@ import { AlphabetLowercase, AlphabetUppercase } from './alphabet';

required?: boolean;
/**
* also accept an environment variable as input
*/
env?: string;
parse(input: I): T;

@@ -16,0 +20,0 @@ };

19

lib/parse.js

@@ -153,11 +153,16 @@ "use strict";

const flag = this.input.flags[k];
if (flags[k])
if (flags[k] || flag.type !== 'option')
continue;
if (flag.type !== 'option' || !flag.default)
continue;
if (typeof flag.default === 'function') {
flags[k] = flag.default({ options: flag, flags });
if (flag.env) {
let input = process.env[flag.env];
if (input)
flags[k] = flag.parse(input);
}
else {
flags[k] = flag.default;
if (!flags[k] && flag.default) {
if (typeof flag.default === 'function') {
flags[k] = flag.default({ options: flag, flags });
}
else {
flags[k] = flag.default;
}
}

@@ -164,0 +169,0 @@ }

{
"name": "@anycli/parser",
"description": "arg and flag parser for anycli",
"version": "3.0.4",
"version": "3.1.0",
"author": "Jeff Dickey @jdxcode",

@@ -6,0 +6,0 @@ "bugs": "https://github.com/anycli/parser/issues",

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