From 7654fddbba64d6145ad9301056db56ee4d77db0f Mon Sep 17 00:00:00 2001 From: dojyorin Date: Fri, 29 Dec 2023 00:28:56 +0900 Subject: [PATCH] fix error handling. --- src/byte.ts | 2 ++ src/env.deno.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/byte.ts b/src/byte.ts index 16fdd5b..e1e39da 100644 --- a/src/byte.ts +++ b/src/byte.ts @@ -8,6 +8,7 @@ export interface BlobType{ "base64": string; "byte": Uint8Array; "buffer": ArrayBuffer; + "stream": ReadableStream; } /** @@ -24,6 +25,7 @@ export async function blobConvert(blob:Blob, type:T):P case "base64": return b64Encode(new Uint8Array(await blob.arrayBuffer())); case "byte": return new Uint8Array(await blob.arrayBuffer()); case "buffer": return await blob.arrayBuffer(); + case "stream": return blob.stream(); default: throw new Error(); } } diff --git a/src/env.deno.ts b/src/env.deno.ts index d50e930..8330da0 100644 --- a/src/env.deno.ts +++ b/src/env.deno.ts @@ -19,7 +19,7 @@ export function envGet(key:string, t if(env === undefined){ if(required){ - throw new Error(key); + throw new Error(); } else{ return env;