egoist/tinyargs

Better TypeScript support

Open

#2 aberto em 13 de dez. de 2021

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)TypeScript (76 stars) (2 forks)user submission
help wanted

Description

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 }

Guia do colaborador