Remix
Remix
remix/assert · FunctionView Source

ok

Summary

Asserts that value is truthy. Narrows the type of value after the call.

Signature

function ok(value: unknown, message: string): asserts value;

Example

const cookie = getSessionCookie(response);
assert.ok(cookie); // cookie is now `string` (not `string | null`)

Parameters

value

The value to test for truthiness.

message

Optional failure message.