UNPKG

@lou.codes/test

Version:

✅ Equality test with enforced readability

17 lines (16 loc) 589 B
import type { Test } from "./Test.js"; /** * Check if given value is a `Test`. * * @category Test * @example * ```typescript * isTest({ given: "🟢", must: "🟩", received: () => "🟩", wanted: () => "🟩" }); // true * isTest({ given: "🟢", must: "🟩", received: "🟩", wanted: "🟩" }); // false * isTest({ given: 1, must: 2, received: 3, wanted: 4 }); // false * isTest(); // false * ``` * @param value Value to check. * @returns `true` if is a `Test`, `false` otherwise. */ export declare const isTest: <Actual = unknown>(value: Actual | Test) => value is Test;