@samual/assert
v0.0.1
Published
Assertion library.
Maintainers
Readme
Samual's Assertion Library
Requires Node.js 20.10+, 22.0+, 24.0+, or above.
Example
import { assert, expect } from "@samual/assert"
// Throws if `someValue` is falsy
assert(someValue)
// `expect()` throws if `someOtherValue` is nullish or just returns the value
doSomething(expect(someOtherValue))
// This is like doing `doSomething(someOtherValue!)` in TypeScript but enforced
// in JavaScriptThis package is also available on JSR.
