Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error handling. #87

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/byte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface BlobType{
"base64": string;
"byte": Uint8Array;
"buffer": ArrayBuffer;
"stream": ReadableStream<Uint8Array>;
}

/**
Expand All @@ -24,6 +25,7 @@ export async function blobConvert<T extends keyof BlobType>(blob:Blob, type:T):P
case "base64": return <BlobType[T]>b64Encode(new Uint8Array(await blob.arrayBuffer()));
case "byte": return <BlobType[T]>new Uint8Array(await blob.arrayBuffer());
case "buffer": return <BlobType[T]>await blob.arrayBuffer();
case "stream": return <BlobType[T]>blob.stream();
default: throw new Error();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/env.deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function envGet<T extends keyof EnvType, U extends boolean>(key:string, t

if(env === undefined){
if(required){
throw new Error(key);
throw new Error();
}
else{
return <U extends true ? EnvType[T] : EnvType[T] | undefined>env;
Expand Down