function recursiveGet(hierarchicalObject, getChildren) {
  var allItems = [];
  var children = getChildren(hierarchicalObject);

  if (children) {
    var _iterator2 = _createForOfIteratorHelper(children),
        _step2;

    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var child = _step2.value;
        allItems.push(child);
        var descendants = recursiveGet(child, getChildren);
        if (descendants) allItems = [].concat(_toConsumableArray(allItems), _toConsumableArray(descendants));
      }
    } catch (err) {
      _iterator2.e(err);
    } finally {
      _iterator2.f();
    }
  }

  return allItems;
}
/**
 * Recursively gets a set of objects within a hierarchical dataset.
 * 
 * @param {object} hierarchicalObject The initial hierarchical object to start the recursive get.
 * @param {function} getChildren The callback function that gets the children items of the hierarchical object.
 */
Recursively gets a set of objects within a hierarchical dataset.

@param {object} hierarchicalObject The initial hierarchical object to start the recursive get.
@param {function} getChildren The callback function that gets the children items of the hierarchical object.
Recursively gets a set of objects within a hierarchical dataset . @param { object } hierarchicalObject The initial hierarchical object to start the recursive get . @param { function } getChildren The callback function that gets the children items of the hierarchical object .
function recursiveGet(hierarchicalObject, getChildren) {
  var allItems = [];
  var children = getChildren(hierarchicalObject);
  if (children) {
    var _iterator2 = _createForOfIteratorHelper(children),
        _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var child = _step2.value;
        allItems.push(child);
        var descendants = recursiveGet(child, getChildren);
        if (descendants) allItems = [].concat(_toConsumableArray(allItems), _toConsumableArray(descendants));
      }
    } catch (err) {
      _iterator2.e(err);
    } finally {
      _iterator2.f();
    }
  }
  return allItems;
}
function recursiveGet ( hierarchicalObject , getChildren ) { var allItems = [ ] ; var children = getChildren ( hierarchicalObject ) ; if ( children ) { var _iterator2 = _createForOfIteratorHelper ( children ) , _step2 ; try { for ( _iterator2 . s ( ) ; ! ( _step2 = _iterator2 . n ( ) ) . done ; ) { var child = _step2 . value ; allItems . push ( child ) ; var descendants = recursiveGet ( child , getChildren ) ; if ( descendants ) allItems = [ ] . concat ( _toConsumableArray ( allItems ) , _toConsumableArray ( descendants ) ) ; } } catch ( err ) { _iterator2 . e ( err ) ; } finally { _iterator2 . f ( ) ; } } return allItems ; }
Recursively gets a set of objects within a hierarchical dataset.
Recursively gets a set of objects within a hierarchical dataset .