It's common and useful for a library developer to export functions with a Result type. You can simply export your function by just wrap them.
Result
wrap
Here's an example to show a safe function to parse JSON.
import {wrap} from 'unwrapit' export const parseJson = wrap(JSON.parse)
Last updated 2 years ago