UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

24 lines (22 loc) 447 B
import { dfdlT } from "@monstermann/dfdl"; //#region src/function/is.ts /** * `is(source)` * * Checks if two values are strictly equal using `===` or `Object.is`. * * ```ts * is(5, 5); // true * is("hello", "world"); // false * ``` * * ```ts * pipe(5, is(5)); // true * pipe("hello", is("world")); // false * ``` */ const is = dfdlT((target, source) => { return target === source || Object.is(target, source); }, 2); //#endregion export { is };