Skip to main content
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.25/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