Skip to main content
Module

x/oak_commons/assert.ts>assert

A set of APIs for handling HTTP and HTTPS requests with Deno 🐿️ 🦕
Very Popular
Go to Latest
function assert
import { assert } from "https://deno.land/x/oak_commons@0.13.0/assert.ts";

A standard assert function, but if the condition is not met, it will throw an HttpError. The error status and text can be changed, but defaults to 400 Bad Request.

Parameters

condition: unknown
optional
message = [UNSUPPORTED]
optional
errorStatus: ErrorStatus = [UNSUPPORTED]
optional
options: HttpErrorOptions

Returns

asserts condition