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

fix(purify): Fix _isNode Function #845

Merged
merged 5 commits into from
Aug 6, 2023
Merged

Conversation

ssi02014
Copy link
Contributor

@ssi02014 ssi02014 commented Aug 4, 2023

Summary

Hello 👋, @cure53

I determined that _isNode is a function that determines whether the given object argument is a DOM Node.

Can typeof Node result in object?
In my tests, Node gets "function" as the result of the "typeof" operator.

console.log(typeof Node); // 'function'

I checked on safari, firefox, Edge, and Chrome and found that the result of typeof Node is function. (Of course, in Node.js, the undefined)

e744840
Looking at the previous commit history, I think it's because of the code like typeof Node === 'object' that doesn't work properly.

We simply need to make sure that the result of "typeof Node" is 'function' and that the object is an instance of Node.

typeof Node === 'function' && object instanceof Node;

After fixing the code, the tests all passed.
Please review this pull request to see if it's appropriate. 🙏

  • Firefox
    스크린샷 2023-08-05 오전 2 44 36

  • chrome

스크린샷 2023-08-05 오전 2 45 28
  • safari
    스크린샷 2023-08-05 오전 2 46 10

  • Edge
    KakaoTalk_Photo_2023-08-05-04-15-49

Tasks

  • fix _isNode

@ssi02014 ssi02014 changed the title fix(purify): Fix _isNode function fix(purify): Fix _isNode Function Aug 4, 2023
@cure53
Copy link
Owner

cure53 commented Aug 6, 2023

Thanks again!

I believe the commits back then were mostly needed for MSIE. Since we are phasing out support for MSIE and only support it in the low-frequently maintained 2.x branch, this change for main and 3.x should be fine 😅

@cure53 cure53 merged commit d5060b3 into cure53:main Aug 6, 2023
6 checks passed
@ssi02014 ssi02014 deleted the fix/purify branch August 6, 2023 12:54
@ssi02014
Copy link
Contributor Author

ssi02014 commented Aug 6, 2023

@cure53 Thanks for explaining the history!

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.

2 participants