Skip to content

broken types for parse #184

@alecf

Description

@alecf

by adding |number to the value side of ParsedQuery, you've changed the return type in a really breaking the type signature for users who don't use parseNumbers - now every use of this generates errors like this:

[devserver] TS2345: Argument of type 'string | number | ReactText[]' is not assignable to parameter of type 'string | string[]'.
[devserver]   Type 'number' is not assignable to type 'string | string[]'.

This is only going to get worse when #183 is fixed.

I'd like to suggest either a complex typescript signature such that only passing parseNumbers results in the new string |number| (number|string)[], or introduce a new function parseValues which does the number/boolean/etc

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions