diff --git a/deno.json b/deno.json index 0985ba8..9979d6f 100644 --- a/deno.json +++ b/deno.json @@ -1,7 +1,8 @@ { "name":"@disgruntleddevs/make-safe-func", + "description":"Finally be sure your function don't throw", "license":"MIT", - "version":"0.0.2", + "version":"0.0.3", "exports":"./src/index.ts", "tasks": { "dev": "deno run --watch main.ts" diff --git a/src/index.ts b/src/index.ts index 28514ae..74f93c4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,8 @@ import {type Result,ok,err} from "npm:neverthrow@8.0.0"; type AnyFunction=(...args:any[])=>any; - +/** +**/ export function makeSafeFunction(fn:F):(...args:Parameters)=>Result extends Promise?R:ReturnType,Error>{ // @ts-ignore: still yet to figure this out but it works return (...args:Parameters)=>{