Skip to main content
Module

x/ddc_vim/deps.ts>ensure

Dark deno-powered completion framework for neovim/Vim8
Go to Latest
function ensure
import { ensure } from "https://deno.land/x/ddc_vim@v3.9.0/deps.ts";

Ensures that the given value satisfies the provided predicate.

import { ensure } from "./util.ts";
import is from "./is.ts";

const a: unknown = "hello";
const _: string = ensure(a, is.String);

Parameters

x: unknown

The value to be ensured.

pred: Predicate<T>

The predicate function to test the value against.

optional
options: { message?: string; } = [UNSUPPORTED]

Optional configuration for the assertion.

Returns

The input value x.