UNPKG

@fedify/fedify

Version:

An ActivityPub server framework

27 lines (23 loc) 818 B
import { Temporal } from "@js-temporal/polyfill"; import { URLPattern } from "urlpattern-polyfill"; globalThis.addEventListener = () => {}; import { AssertionError } from "./assert_equals-CTYbeopb.js"; //#region node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert.js /** * Make an assertion, error will be thrown if `expr` does not have truthy value. * * @example Usage * ```ts no-eval * import { assert } from "@std/assert/assert"; * * assert("hello".includes("ello")); // Doesn't throw * assert("hello".includes("world")); // Throws * ``` * * @param expr The expression to test. * @param msg The optional message to display if the assertion fails. */ function assert(expr, msg = "") { if (!expr) throw new AssertionError(msg); } //#endregion export { assert };