Skip to main content
Module

x/dpp_vim/deps.ts>ensure

Dark powered plugin manager for Vim/neovim
Latest
function ensure
import { ensure } from "https://deno.land/x/dpp_vim@v0.2.0/deps.ts";

Ensures that the given value satisfies the provided predicate.

import { ensure, is } from "@core/unknownutil";

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; name?: string; } = [UNSUPPORTED]

Optional configuration for the assertion.

Returns

The input value x.