Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Inalegwu committed Sep 22, 2024
1 parent ce157e5 commit c45c430
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "@disgruntleddevs/make-safe-func",
"description": "Finally be sure your functions don't throw",
"license": "MIT",
"version": "0.1.1",
"version": "0.1.2",
"exports": "./src/index.ts",
"tasks": {
"dev": "deno run --watch main.ts"
"dev": "deno run --watch src/test.ts"
},
"imports": {
"@std/assert": "jsr:@std/assert@1",
Expand Down
8 changes: 7 additions & 1 deletion src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ const safeAsyncFunction = makeSafeFunction(unsafeAsyncFunction);
const safeDivide = makeSafeFunction(unsafeDivide);

const result = await safeAsyncFunction("https://google.com").unwrapOr(
new Response("hello world"),
new Response("hello world",{
status:200,
statusText:"Success",
headers:{
"content-type":"application/json",
}
}),
);

const divideResult = safeDivide(1, 2).unwrapOr(0);
Expand Down

0 comments on commit c45c430

Please sign in to comment.