Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fathym_common/src/src.deps.ts>includesValue

The Fathym Reference Architecture provides the common foundation for applications built in Typescript.
Go to Latest
function includesValue
import { includesValue } from "https://deno.land/x/fathym_common@v0.0.155/src/src.deps.ts";

If the given value is part of the given object it returns true, otherwise it returns false. Doesn't work with non-primitive values: includesValue({x: {}}, {}) returns false.

Examples

Example 1

import { includesValue } from "https://deno.land/std@0.224.0/collections/includes_value.ts";
import { assertEquals } from "https://deno.land/std@0.224.0/assert/assert_equals.ts";

const input = {
  first: 33,
  second: 34,
};

assertEquals(includesValue(input, 34), true);

Parameters

record: Readonly<Record<string, T>>
value: T

Returns

boolean