UNPKG

@knora/api

Version:

JavaScript library that handles API requests to Knora

20 lines 746 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 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 = exports.ListConversionUtil || (exports.ListConversionUtil = {})); //# sourceMappingURL=list-conversion-util.js.map