Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/polkadot/util/assert.ts>assert

Package publishing for deno.land/x/polkadot
Go to Latest
function assert
import { assert } from "https://deno.land/x/polkadot@0.2.11/util/assert.ts";

Examples

const { assert } from '@polkadot/util';

assert(true, 'True should be true'); // passes
assert(false, 'False should not be true'); // Error thrown
assert(false, () => 'message'); // Error with 'message'

Parameters

condition: unknown
message: string | MessageFn

Returns

asserts condition