- fixed a bug in dnTaverseTree where children would get pushed into the result in reverse order

- added an inode display to the `printTree` algorithm

- removed a redundant type in *`signal.ts`*
- improved `resolveInode` to now take `ShellState` instead of `FileSystem` and added an optional `abs` *`boolean`* argument to determine if the retuned path should be normalized or absolute

- implemented a builtin `TreeNode` quicksort function
- changed the `TreeNodeType` to a numeric enum
- added a standalone `Posix` class that holds a const with character weights compliant with posix
This commit is contained in:
2026-08-25 06:34:23 +02:00
parent dad18cd4cc
commit 20718604e4
9 changed files with 294 additions and 30 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ export function printTree(fs: FileSystem, root: number): string {
const lines: string[] = [];
lines.push(rootNode.name);
lines.push(rootNode.name + ` (${rootNode.inode})`);
type Frame = {
inode: number;
@@ -42,7 +42,7 @@ export function printTree(fs: FileSystem, root: number): string {
const name = node.name;
const connector = frame.isLast ? "└── " : "├── ";
lines.push(frame.prefix + connector + name);
lines.push(frame.prefix + connector + name + ` (${node.inode})`);
if (node.type === TreeNodeType.Directory) {
const childPrefix = frame.prefix + (frame.isLast ? " " : "│ ");