Closed ssi02014 closed 1 year ago
Hello 👋, @cure53
Node property "content" is not currently available. There's no need to conditionally check it, as it always returns undefined.
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
NodeType
After fixing the code, the tests all passed, and I think it's safe to remove it from 3.x.
3.x
Remove unnecessary conditional expressions
This should be safe, let me do some checks and merge, thanks :slightly_smiling_face:
Summary
Hello 👋, @cure53
Node property "content" is not currently available. There's no need to conditionally check it, as it always returns
undefined
.I went through all the
NodeType
listed in the documentation below. https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeTypeAfter fixing the code, the tests all passed, and I think it's safe to remove it from
3.x
.Tasks
Remove unnecessary conditional expressions