Closed gomain closed 2 years ago
OK, this feature is actually available through the filter
option.
const queryString = qs.stringify(
query,
{
filter: (prefix: string, value: unknown) => {
if (isDateRagne(value)) {
return selfImplementedStringify(value);
}
return value;
},
},
},
);
This would have been more obvious had the option was named filterMap
.
created #447 and #448
Sounds like your issue was resolved.
I have a case where a backend accepts values say for a key
created
accepts a date range of the format:For that I have a custom type
And my query type:
Now passing this to
qs
I need to:Now this gets cumbersome when
DateRange
is reused across multiple api, multiple keys, ...I request feature that would allow this:
or perhaps
This would allow any sort of custom serialization to be handled in user land. On top of the great defaults and options that
qs
already provides. Not just forDate
s.