(content: ZipEntryData)
| 193 | } |
| 194 | |
| 195 | async function toUint8Array(content: ZipEntryData): Promise<Uint8Array<ArrayBuffer>> { |
| 196 | if (typeof content === "string") { |
| 197 | return new TextEncoder().encode(content) as Uint8Array<ArrayBuffer>; |
| 198 | } |
| 199 | if (content instanceof Uint8Array) { |
| 200 | return content as Uint8Array<ArrayBuffer>; |
| 201 | } |
| 202 | if (content instanceof ArrayBuffer) { |
| 203 | return new Uint8Array(content); |
| 204 | } |
| 205 | if (typeof Blob !== "undefined" && content instanceof Blob) { |
| 206 | return new Uint8Array(await content.arrayBuffer()); |
| 207 | } |
| 208 | return new TextEncoder().encode(String(content)) as Uint8Array<ArrayBuffer>; |
| 209 | } |
no test coverage detected