Skip to main content
Module

x/polkadot/mod.ts>util.assert

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

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