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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(purify): Remove unnecessary conditional expressions #848

Merged
merged 1 commit into from Aug 9, 2023

Conversation

ssi02014
Copy link
Contributor

@ssi02014 ssi02014 commented Aug 9, 2023

Summary

Hello 馃憢, @cure53

Node property "content" is not currently available.
There's no need to conditionally check it, as it always returns undefined.

currentNode.content; // Always undefined
currentNode.content.firstElementChild; // Always undefined
(!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) // Always true

I went through all the NodeType listed in the documentation below.
https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType

After fixing the code, the tests all passed, and I think it's safe to remove it from 3.x.

Tasks

Remove unnecessary conditional expressions

@cure53
Copy link
Owner

cure53 commented Aug 9, 2023

This should be safe, let me do some checks and merge, thanks 馃檪

@cure53 cure53 merged commit 59c7807 into cure53:main Aug 9, 2023
6 checks passed
@ssi02014 ssi02014 deleted the fix/purify branch August 10, 2023 15:42
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.

None yet

2 participants