- Cleaned up old tests

- Changed `node:buffer` and `node:streams` imports to native `WebWorkers` imports;
- Fixed tests that used old `toPtr` and `fromPtr` functions to use the new NodePointer class methods
- Exposed pointer resolution helper functions to the consumer
This commit is contained in:
2026-11-20 12:22:23 +01:00
parent 2cf84ccd2f
commit d825299e26
20 changed files with 152 additions and 738 deletions
+2 -4
View File
@@ -1,8 +1,6 @@
import type { UserInfo } from "@core/session_manager";
import { upTraverseTree } from "@core/util/tree_traversal";
import { VDiskManager } from "@core/util/vdisk_manager";
import type { Blob } from "node:buffer";
import type { Readable } from "node:stream";
import type {
AlreadyExistsError,
DeviceNotFoundError,
@@ -379,7 +377,7 @@ export class FileSystem {
mode: number;
owner: number;
group: number;
content: Blob | Readable;
content: Blob | ReadableStream;
size: number;
}
| { type: NodeType.Directory; mode: number; owner: number; group: number }
@@ -507,7 +505,7 @@ export class FileSystem {
await dev.writeContent((node as FileNode).content, content);
}
public streamContent(target: NodePointer): Readable {
public streamContent(target: NodePointer): ReadableStream {
const dev = this._VDiskManager.getDisk(target.device);
const node = this.resolveNode(target);