Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit 15bb0d0

Browse files
committed
fix: remove optionType
1 parent 25f41b8 commit 15bb0d0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/flags.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export type IBooleanFlag<T> = IFlagBase<T, boolean> & {
2424

2525
export type IOptionFlag<T> = IFlagBase<T, string> & {
2626
type: 'option'
27-
optionType: string
2827
helpValue?: string
2928
default?: T | ((context: DefaultContext<T>) => T | undefined)
3029
multiple: boolean
@@ -69,18 +68,17 @@ export function boolean<T = boolean>(options: Partial<IBooleanFlag<T>> = {}): IB
6968
}
7069

7170
export const integer = build({
72-
optionType: 'integer',
7371
parse: input => {
7472
if (!/^[0-9]+$/.test(input)) throw new Error(`Expected an integer but received: ${input}`)
7573
return parseInt(input, 10)
7674
},
7775
})
7876

7977
export function option<T>(options: {parse: IOptionFlag<T>['parse']} & Partial<IOptionFlag<T>>) {
80-
return build<T>({optionType: 'custom', ...options})()
78+
return build<T>(options)()
8179
}
8280

83-
const stringFlag = build({optionType: 'string'})
81+
const stringFlag = build({})
8482
export {stringFlag as string}
8583

8684
export const defaultFlags = {

0 commit comments

Comments
 (0)