Package Exports
- @akromio/peval
- @akromio/peval/dist/cjs/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@akromio/peval) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@akromio/peval
A helper function to run a function and to return an array with two elements:
The first indicating if the call ended ok: true or false.
The second indicating the value returned or the error raised.
Product of Spain, made in Valencia by Sia Codelabs.
Use
import peval from "@akromio/peval"
// ...
const [ok, value] = peval(() => fun(1, 2, 3))
if (ok) {
// value contains the value returned by the call
} else {
// value contains the error raised
}