Say that I have search view that has different fields and all are optional. Due to usage of typescript, I need to provide an interface which contains all the fields, but not all fields need to be set (they're undefined if they're not set).
Current implementation of UrlSearchParams appends keys without any value, which is undesired behaviour.
Say that I have (pseudo code, not actually tested, and I can't provide actual code)
interface Foo {
bar: string;
baz: string;
}
const foo: Partial = { bar: 'baz' };
const params = new UrlSearchParams(foo);
params.toString() =>
baz&bar=baz
I believe the "baz" should not be shown at all in the resulting string.
Enhancement
Package Version: Beta 5
Say that I have search view that has different fields and all are optional. Due to usage of typescript, I need to provide an interface which contains all the fields, but not all fields need to be set (they're undefined if they're not set).
Current implementation of UrlSearchParams appends keys without any value, which is undesired behaviour.
Say that I have (pseudo code, not actually tested, and I can't provide actual code)
interface Foo { bar: string; baz: string; }
const foo: Partial = { bar: 'baz' };
const params = new UrlSearchParams(foo);
params.toString() =>
baz&bar=baz
I believe the "baz" should not be shown at all in the resulting string.