UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

25 lines (23 loc) 572 B
import { is } from "../function/is.js"; import { dfdlT } from "@monstermann/dfdl"; //#region src/object/is.ts /** * `is(target, key, value)` * * Checks if the `key` property of `target` object is equal to the specified `value` using strict equality. * * ```ts * is({ a: 1, b: 2 }, "a", 1); // true * is({ a: 1, b: 2 }, "a", 2); // false * ``` * * ```ts * pipe({ a: 1, b: 2 }, is("a", 1)); // true * pipe({ a: 1, b: 2 }, is("a", 2)); // false * ``` */ const is$1 = dfdlT((target, key, value) => { return is(target[key], value); }, 3); //#endregion export { is$1 as is };