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

refactor: add util function to normalize node argument #3998

Merged
merged 4 commits into from
May 12, 2023
Merged

Conversation

straker
Copy link
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
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.

lib/core/utils/normalize-node.js Outdated Show resolved Hide resolved
lib/core/utils/normalize-node.js Outdated Show resolved Hide resolved
Comment on lines 10 to 11
export default function arialabelText(element) {
const { vNode } = normalizeNode(element);
Copy link
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