Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add undefined to JSON.stringify return type (#51897)" #52307

Merged
merged 3 commits into from
Jan 19, 2023

Conversation

sandersn
Copy link
Member

This reverts commit c7f49bc because of breaks like these found in github repositories:

function x(obj: object, key: string) {
    encodeURIComponent(JSON.stringify(obj[key as keyof typeof obj]))
}
function y(value: string) {
    if (typeof value !== 'string') {
        value = JSON.stringify(value)
    }
}
function z(file: PathOrFileDescriptor, obj: any, options: WriteFileOptions) {
    writeFileSync(file, JSON.stringify(obj, options?.replacer, options?.spaces), options)
}

(The last example depends on @types/fs-extra)

Discussed at the January 18 design meeting.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jan 19, 2023
@sandersn sandersn merged commit ecaf6d9 into microsoft:main Jan 19, 2023
@ecyrbe
Copy link

ecyrbe commented Jan 21, 2023

Will another fix for undefined be attempted ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants