Enchantrix/vault/lib/parse/file.ts
google-labs-jules[bot] 9f60f5696b feat: Expand test coverage for chachapoly
This commit expands the test coverage for the `chachapoly` package to include error and edge cases. It also adds `go.sum` to the `.gitignore` file.
2025-10-30 19:35:51 +00:00

33 lines
760 B
TypeScript

#!deno run --allow-read --allow-net
import * as path from "https://deno.land/std@0.122.0/path/mod.ts";
import { readableStreamFromReader } from "https://deno.land/std@0.122.0/streams/mod.ts";
import {EnchantrixLog} from '../log.ts';
export class EnchantrixParseFile {
protected _input: string;
protected _data: any;
constructor(file: string) {
this._input = file;
}
load() {
try {
this._data = Deno.openSync(this._input, { read: true });
const stat = this._data.statSync();
} catch {
throw new EnchantrixLog('Failed to load file')
}
// Build a readable stream so the file doesn't have to be fully loaded into
// memory while we send it
const readableStream = readableStreamFromReader(this._data);
return readableStream
}
}