How to use the domutils.getChildren function in domutils

To help you get started, we’ve selected a few domutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jgardella / compat / src / html / detect.js View on Github external
function applyFuncToDOMNodes (dom, func) {
  func(dom)
  const children = domutils.getChildren(dom)
  if (children !== undefined) {
    children.forEach((child) => {
      applyFuncToDOMNodes(child, func)
    })
  }
}