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

Always set added and removed to true or false, rather than leaving them unset or explicitly using undefined #455

Merged
merged 2 commits into from
Jan 2, 2024

Conversation

ExplodingCabbage
Copy link
Collaborator

Resolves #233. I figure this makes the types returned by the library a bit simpler (added and removed can simply be considered always-present booleans rather than being boolean-or-undefined-or-maybe-omitted-entirely like they are now) which in turn makes it easier for someone to make sense of the values we returned, especially if they're not intimately familiar with jsdiff but reading code that uses jsdiff in an edit that shows them type definitions.

(Obviously, actually having up-to-date type definitions is a further prerequisite for this change to be useful - hence I'd like to do #303, too, for the 6.0.0 release.)

@ExplodingCabbage ExplodingCabbage merged commit 3a99253 into 6.0.0-staging Jan 2, 2024
@ExplodingCabbage ExplodingCabbage deleted the undefined-false branch January 2, 2024 17:57
ryota-ka added a commit to ryota-ka/DefinitelyTyped that referenced this pull request Oct 1, 2024
ryota-ka added a commit to ryota-ka/DefinitelyTyped that referenced this pull request Oct 8, 2024
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.

1 participant