egoist/tinyargs

Better TypeScript support

Open

#2 aperta il 13 dic 2021

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

Metriche repository

Star
 (76 star)
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