Comparing version 1.0.10 to 1.0.11
@@ -5,2 +5,5 @@ import { Flag, IFlagOptions } from './base'; | ||
default?: T; | ||
parse?: (input: string, options: { | ||
[k: string]: any; | ||
}) => T; | ||
} | ||
@@ -7,0 +10,0 @@ export interface IOptionFlagBase<T> extends Flag { |
@@ -24,5 +24,8 @@ "use strict"; | ||
get value() { | ||
if (this.options.default) | ||
const input = this.input[0]; | ||
if (!input && this.options.default) | ||
return this.options.default; | ||
return this.parse(this.input[0]); | ||
if (this.options.parse) | ||
return this.options.parse(input, {}); | ||
return this.parse(input); | ||
} | ||
@@ -29,0 +32,0 @@ }; |
{ | ||
"name": "cli-flags", | ||
"description": "basic CLI flag parser", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"author": "Jeff Dickey", | ||
@@ -10,3 +10,3 @@ "bugs": "https://github.com/jdxcode/cli-flags/issues", | ||
"lodash": "^4.17.4", | ||
"ts-lodash": "^4.0.4" | ||
"ts-lodash": "^4.0.5" | ||
}, | ||
@@ -17,2 +17,3 @@ "devDependencies": { | ||
"@types/node": "^8.0.28", | ||
"babel-core": "^6.26.0", | ||
"del-cli": "^1.1.0", | ||
@@ -19,0 +20,0 @@ "husky": "^0.14.3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19913
501
15
Updatedts-lodash@^4.0.5