egoist/tinyargs

Better TypeScript support

Open

#2 opened on Dec 13, 2021

View on GitHub
 (0 comments) (0 reactions) (0 assignees)TypeScript (2 forks)user submission
help wanted

Repository metrics

Stars
 (76 stars)
PR merge metrics
 (No merged PRs in 30d)

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 }

Contributor guide