Socket
Socket
Sign inDemoInstall

@oclif/parser

Package Overview
Dependencies
9
Maintainers
4
Versions
44
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.7.2 to 3.7.3

lib/metadata.d.ts

9

CHANGELOG.md

@@ -0,1 +1,10 @@

## [3.7.3](https://github.com/oclif/parser/compare/v3.7.2...v3.7.3) (2019-03-15)
### Bug Fixes
* ignore defaulted flags for exclusivity ([1dfe62a](https://github.com/oclif/parser/commit/1dfe62a))
## [3.7.2](https://github.com/oclif/parser/compare/v3.7.1...v3.7.2) (2018-12-18)

@@ -2,0 +11,0 @@

4

lib/parse.d.ts
import { Arg } from './args';
import * as Flags from './flags';
import { Metadata } from './metadata';
export declare type OutputArgs<T extends ParserInput['args']> = {

@@ -14,2 +15,3 @@ [P in keyof T]: any;

raw: ParsingToken[];
metadata: Metadata;
};

@@ -40,2 +42,3 @@ export declare type ArgToken = {

private readonly context;
private readonly metaData;
private currentFlag?;

@@ -48,2 +51,3 @@ constructor(input: T);

raw: ParsingToken[];
metadata: any;
};

@@ -50,0 +54,0 @@ private _args;

@@ -29,2 +29,3 @@ "use strict";

this.booleanFlags = pickBy(input.flags, f => f.type === 'boolean');
this.metaData = {};
}

@@ -120,2 +121,3 @@ parse() {

raw: this.raw,
metadata: this.metaData
};

@@ -133,2 +135,3 @@ }

const flags = {};
this.metaData.flags = {};
for (const token of this._flagTokens) {

@@ -172,2 +175,3 @@ const flag = this.input.flags[token.flag];

if (!(k in flags) && flag.default !== undefined) {
this.metaData.flags[k] = { setFromDefault: true };
if (typeof flag.default === 'function') {

@@ -174,0 +178,0 @@ flags[k] = flag.default(Object.assign({ options: flag, flags }, this.context));

@@ -41,2 +41,7 @@ "use strict";

for (let also of flag.exclusive || []) {
// do not enforce exclusivity for flags that were defaulted
if (parse.output.metadata.flags[also] && parse.output.metadata.flags[also].setFromDefault)
continue;
if (parse.output.metadata.flags[name] && parse.output.metadata.flags[name].setFromDefault)
continue;
if (parse.output.flags[also]) {

@@ -43,0 +48,0 @@ throw new errors_1.CLIError(`--${also}= cannot also be provided when using --${name}=`);

2

package.json
{
"name": "@oclif/parser",
"description": "arg and flag parser for oclif",
"version": "3.7.2",
"version": "3.7.3",
"author": "Jeff Dickey @jdxcode",

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

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