Last active
November 5, 2017 11:57
-
-
Save nblackburn/8040f90935b6db3344b485ff282c8d77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (node, callback) => { | |
if (node.childNodes) { | |
for (let index = 0; index < node.childNodes.length; index++) { | |
const child = node.childNodes[index] | |
const next = callback(child) | |
if (!next) { | |
walk(child, callback) | |
} | |
} | |
} | |
if (node.shadowRoot) { | |
walk(node.shadowRoot, callback) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment