A Pen by FridayCandour on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Xtree { | |
private base: Map<string, any>; // Base storage mapping IDs to data | |
private nodes: Map<string, Map<any, Set<string>>>; // Nodes for different attributes | |
constructor() { | |
this.base = new Map<string, any>(); // ID is now always a string | |
this.nodes = new Map<string, any>(); | |
} | |
// Add or update data in the tree | |
index(id: string, data: Record<string, any>): void { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
import util from "node:util"; | |
import path from "node:path"; | |
import fs from "node:fs"; | |
import child_process from "node:child_process"; | |
// Parse command line arguments | |
const P_args = process.argv.slice(2); | |
const seen_p = {}; |