8000
Skip to content

[Fix] stringify: serialize Date values returned unchanged by a filter function - #593

Open
deepshekhardas wants to merge 1 commit into
ljharb:mainfrom
deepshekhardas:fix/467-filter-date-serialization
Open

[Fix] stringify: serialize Date values returned unchanged by a filter function#593
deepshekhardas wants to merge 1 commit into
ljharb:mainfrom
deepshekhardas:fix/467-filter-date-serialization

Conversation

@deepshekhardas
Copy link
Copy Markdown

When a filter function returns a Date value unchanged, it was previously serialized as the empty string (its own enumerable keys) and silently dropped from the output. Now serializeDate is applied to the filtered value, matching the no-filter path.

const date = new Date();
qs.stringify({ a: date }, { filter: (prefix, value) => value });
// was: ''
// now: 'a=...'

Closes #467

@ljharb ljharb closed this Aug 28, 2026
@ljharb ljharb reopened this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Serialization for Date is not working when using filter option.

2 participants

0