@dasch-swiss/dsp-js
Version:
TypeScript client library for DSP-API
21 lines • 657 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 = (node) => {
// collection of nodes to add to
let subnodes = [];
node.children.forEach((child) => {
subnodes = subnodes.concat(ListConversionUtil.collectNodes(child));
});
return [node].concat(subnodes);
};
})(ListConversionUtil || (ListConversionUtil = {}));
//# sourceMappingURL=list-conversion-util.js.map