Usage

proxy.ts

wraproxy

import { unwrap } from "@sirutils/core"
import { wraproxy } from "@sirutils/safe-toolbox"
import lib from "any_lib_that_default_exports_an_object"

const safeLib = wraproxy(lib)

// We can put the entire application in forward like this
forward(() => {
    const data = unwrap(safeLib.exampleFn("alice", "zuberg"))

    console.log(data)
}, '?app')

proxy

import { proxy } from "@sirutils/safe-toolbox"
import lib from "any_lib_that_default_exports_an_object"

const safeLib = proxy(lib)

// We can put the entire application in forward like this
forward(() => {
    // You dont need to unwrap because proxy just wraps functions with capsule
    const data = safeLib.exampleFn("alice", "zuberg")

    console.log(data)
}, '?app')