Skip to content

Instantly share code, notes, and snippets.

@nblackburn
Last active November 5, 2017 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nblackburn/8040f90935b6db3344b485ff282c8d77 to your computer and use it in GitHub Desktop.
Save nblackburn/8040f90935b6db3344b485ff282c8d77 to your computer and use it in GitHub Desktop.
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