Skip to content

Conversation

@SbsCruz
Copy link
Contributor

@SbsCruz SbsCruz commented Jan 16, 2026

Added the toBeEmpty matcher.

@SbsCruz SbsCruz requested a review from suany0805 January 16, 2026 19:20
@SbsCruz SbsCruz requested a review from JDOM10 January 22, 2026 20:07
Copy link
Collaborator

@JDOM10 JDOM10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work @SbsCruz! The only thing to review is the comment above with the rest of the team. Other than that, it looks great to me! 👍

}

export function isElementEmpty (element: Element): boolean {
const nonCommentChildNodes = [...element.childNodes].filter(child => child.nodeType !== 8);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we use nodeType != 8. What does 8 represent?

You could refactor this to be a constant based on what it is.

const NODE_TYPE_ABCD _ID = 8;

then you can use the constant so we can avoid hardcoding multiple times this type of data on different scenarios.

Copy link
Contributor Author

@SbsCruz SbsCruz Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

number 8 represents the COMMENT_NODE, (as shown here) so they are excluded from the function,
and sure, i will make it a constant so it's more legible, thanks!

Copy link
Contributor

@suany0805 suany0805 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! just left a couple of comments! Let me know if you would like to pair to review them :)

@SbsCruz SbsCruz requested review from JDOM10 and suany0805 February 2, 2026 17:45
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.

4 participants