npm.io
1.2.5 • Published 11 months ago

@onflow/util-invariant

Licence
Apache-2.0
Version
1.2.5
Deps
1
Size
16 kB
Vulns
0
Weekly
0
Stars
333
import {invariant} from "@onflow/util-invariant"

function add(a, b) {
  invariant(typeof a === "number", "add(a, b) -- `a` needs to be a number", { a, b })
  invariant(typeof b === "number", "add(a, b) -- `b` needs to be a number", { a, b })
  return a + b
}