lib/index.js
function findComponents(nodes, callback) {
  nodes = toArray(nodes);
  nodes = [].slice.call(nodes);
  var node;

  for (var i = 0, l = nodes.length; i < l; i++) {
    node = nodes[i];

    if (node && node.hasAttribute && node.hasAttribute('data-component')) {
      callback(node);
    } else if (node.childNodes && node.childNodes.length) {
      findComponents([].slice.call(node.childNodes), callback);
    }
  }
}
function findComponents(nodes, callback) {
  nodes = toArray(nodes);
  nodes = [].slice.call(nodes);
  var node;

  for (var i = 0, l = nodes.length; i < l; i++) {
    node = nodes[i];

    if (node && node.hasAttribute && node.hasAttribute('data-component')) {
      callback(node);
    } else if (node.childNodes && node.childNodes.length) {
      findComponents([].slice.call(node.childNodes), callback);
    }
  }
}
function findComponents ( nodes , callback ) { nodes = toArray ( nodes ) ; nodes = [ ] . slice . call ( nodes ) ; var node ; for ( var i = 0 , l = nodes . length ; i < l ; i ++ ) { node = nodes [ i ] ; if ( node && node . hasAttribute && node . hasAttribute ( 'data-component' ) ) { callback ( node ) ; } else if ( node . childNodes && node . childNodes . length ) { findComponents ( [ ] . slice . call ( node . childNodes ) , callback ) ; } } }
Recursively Applies a callback on each Node that is found to be a Component
@param {Array} nodes an array of Node
@param {*} callback function to call on each Node that has data-component
Recursively Applies a callback on each Node that is found to be a Component