@dasch-swiss/dsp-js
Version:
JavaScript library that handles API requests to Knora
21 lines • 669 B
JavaScript
/**
* @category Internal
*/
export var ListConversionUtil;
(function (ListConversionUtil) {
/**
* Given a list node, collects the node
* and all of its direct and indirect children.
*
* @param node the node to start with.
*/
ListConversionUtil.collectNodes = function (node) {
// collection of nodes to add to
var subnodes = [];
node.children.forEach(function (child) {
subnodes = subnodes.concat(ListConversionUtil.collectNodes(child));
});
return [node].concat(subnodes);
};
})(ListConversionUtil || (ListConversionUtil = {}));
//# sourceMappingURL=list-conversion-util.js.map