each()

in packages/postsvg/lib/tree.js [76:82]


  each(selector, callback) {
    const hasSelector = typeof selector === 'string';
    const nodes = this.select(hasSelector ? selector : '*');
    return selector
      ? nodes.forEach(typeof selector === 'function' ? selector : callback)
      : nodes;
  }