From 15bb0d0e7ac8d7b933f3a6731f3988ae5786e129 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Mon, 5 Feb 2018 01:16:24 -0800 Subject: [PATCH] fix: remove optionType --- src/flags.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/flags.ts b/src/flags.ts index 7209245..dbb1729 100644 --- a/src/flags.ts +++ b/src/flags.ts @@ -24,7 +24,6 @@ export type IBooleanFlag = IFlagBase & { export type IOptionFlag = IFlagBase & { type: 'option' - optionType: string helpValue?: string default?: T | ((context: DefaultContext) => T | undefined) multiple: boolean @@ -69,7 +68,6 @@ export function boolean(options: Partial> = {}): IB } export const integer = build({ - optionType: 'integer', parse: input => { if (!/^[0-9]+$/.test(input)) throw new Error(`Expected an integer but received: ${input}`) return parseInt(input, 10) @@ -77,10 +75,10 @@ export const integer = build({ }) export function option(options: {parse: IOptionFlag['parse']} & Partial>) { - return build({optionType: 'custom', ...options})() + return build(options)() } -const stringFlag = build({optionType: 'string'}) +const stringFlag = build({}) export {stringFlag as string} export const defaultFlags = {