Skip to content

refactor: add util function to normalize node argument#3998

Merged
straker merged 4 commits intodevelopfrom
normalize-node
May 12, 2023
Merged

refactor: add util function to normalize node argument#3998
straker merged 4 commits intodevelopfrom
normalize-node

Conversation

@straker
Copy link
Copy Markdown
Contributor

@straker straker commented Apr 27, 2023

In preparation for #3896 I decided that instead of needing to import two different things (AbstractVirtualNode and getNodeFromTree) and copying and pasting the same if statement, we should instead have a helper function that does the things for us. So that's what I did.

@straker straker requested a review from a team as a code owner April 27, 2023 21:29
@straker straker changed the title Normalize node refactor: add util function to normalize node argument Apr 27, 2023
Copy link
Copy Markdown
Contributor

@WilcoFiers WilcoFiers left a comment

Choose a reason for hiding this comment

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

Had some ideas, but we should probably discuss before you make changes.

Comment on lines +10 to +11
export default function arialabelText(element) {
const { vNode } = normalizeNode(element);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bummer decorators aren't available yet. I'd love to have this work:

Suggested change
export default function arialabelText(element) {
const { vNode } = normalizeNode(element);
@nodeLookup
export default function arialabelText({ vNode }) {

@straker straker merged commit 4f18976 into develop May 12, 2023
@straker straker deleted the normalize-node branch May 12, 2023 15:20
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