Skip to content

Query param with an empty value #384

Closed
@AlekseyLeshko

Description

@AlekseyLeshko

Thanks for the awesome library!

Sometimes I need to add a query, but I don’t know if exists value.
For example

const epicUrlBuilder = (foo, bar) => URI().addQuery('foo', foo).addQuery('bar', bar)
epicUrlBuilder(42).query() === "foo=42&bar" // not cool
epicUrlBuilder(42).query() === "foo=42" // it’s cool

Yes, of course, I could implement a custom function with this logic.
I think it would be cool if this feature was included in the library.

Maybe update readable or create a new method?

What are you thinking about it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions