mirror of
https://github.com/hanzoai/zap-es.git
synced 2026-10-30 18:17:07 +00:00
12 lines
307 B
TypeScript
12 lines
307 B
TypeScript
import { readFileSync } from "node:fs";
|
|
import * as path from "node:path";
|
|
|
|
export function readFileBuffer(filePath: string): ArrayBuffer {
|
|
const b = readFileSync(path.join(__dirname, "../../", filePath));
|
|
|
|
return b.buffer.slice(
|
|
b.byteOffset,
|
|
b.byteOffset + b.byteLength,
|
|
) as ArrayBuffer;
|
|
}
|