egoist/tinyargs

Better TypeScript support

Aperta

#2 aperta il 13 dic 2021

 (0 commenti) (0 reazioni) (0 assegnatari)TypeScript (2 fork)user submission
help wanted

Metriche repository

Star
 (76 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Currently the return object is typed as Record<string, any>, ideally it should infer types based on options:

parse([], [{ name:'foo', type: Boolean }, { name: 'bar', type: String, optionalValue: true }])

//=> { foo?: boolean, bar?: string | true }

Guida contributor