0.7.1 • Published 2 years ago

@akromio/peval v0.7.1

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

@akromio/peval

NPM version Total downloads

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
}
0.7.1

2 years ago

0.7.0

3 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.4.3

3 years ago

0.6.0

3 years ago

0.5.1

3 years ago

0.4.2

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago