(
fs: {
readFileBytes?(path: string): Promise<ByteString>;
readFileBuffer(path: string): Promise<Uint8Array>;
},
path: string,
)
| 115 | * working. |
| 116 | */ |
| 117 | export async function readBytesFrom( |
| 118 | fs: { |
| 119 | readFileBytes?(path: string): Promise<ByteString>; |
| 120 | readFileBuffer(path: string): Promise<Uint8Array>; |
| 121 | }, |
| 122 | path: string, |
| 123 | ): Promise<ByteString> { |
| 124 | if (typeof fs.readFileBytes === "function") { |
| 125 | return fs.readFileBytes(path); |
| 126 | } |
| 127 | return bytesFromUint8Array(await fs.readFileBuffer(path)); |
| 128 | } |
| 129 | |
| 130 | // --------------------------------------------------------------------------- |
| 131 | // Stdout shape helpers. |
no test coverage detected
searching dependent graphs…