INNER CODE UNIT · JavaScript

nodes

AscensionGameDev/Intersect-Engine · Intersect.Server/wwwroot/js/assets.js:375

		const nodes = Array.isArray(node.children) ? node.children.flatMap(child => this.#flatten(child)) : [];
		if (!omitSelf) {
			nodes.splice(0, 0, node);
		}
		return nodes;
	}

	/**
	 * @param {LocalStorageBrowseNode} node
	 * @param {(LocalStorageBrowseNode) => boolean} predicate
	 * @param {boolean} omitSelf
	 * @returns {LocalStorageBrowseNode[]}
	 */
	#filterTree(node, predicate, omitSelf = false) {
		const nodes = Array.isArray(node.children) ? node.children.filter(predicate).flatMap(child => this.#flatten(child)) : [];
		if (!omitSelf) {
			nodes.splice(0, 0, node);
		}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…