| 178 | } |
| 179 | |
| 180 | async function toZipSource( |
| 181 | content: InputByType[keyof InputByType] |
| 182 | ): Promise<Blob | Uint8Array<ArrayBuffer> | ArrayBuffer> { |
| 183 | if (typeof content === "string") { |
| 184 | return new TextEncoder().encode(content) as Uint8Array<ArrayBuffer>; |
| 185 | } |
| 186 | if (content instanceof Uint8Array || content instanceof ArrayBuffer) { |
| 187 | return content; |
| 188 | } |
| 189 | if (typeof Blob !== "undefined" && content instanceof Blob) { |
| 190 | return content; |
| 191 | } |
| 192 | return new TextEncoder().encode(String(content)) as Uint8Array<ArrayBuffer>; |
| 193 | } |
| 194 | |
| 195 | async function toUint8Array(content: ZipEntryData): Promise<Uint8Array<ArrayBuffer>> { |
| 196 | if (typeof content === "string") { |