- 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:
@@ -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 ? " " : "│ ");
|
||||
|
||||
Reference in New Issue
Block a user