Skip to main content
Module

x/lume/deps/assert.ts>assertObjectMatch

🔥 Static site generator for Deno 🦕
Very Popular
Latest
function assertObjectMatch
import { assertObjectMatch } from "https://deno.land/x/lume@v2.1.4/deps/assert.ts";

Make an assertion that actual object is a subset of expected object, deeply. If not, then throw.

Examples

Example 1

import { assertObjectMatch } from "https://deno.land/std@0.224.0/assert/assert_object_match.ts";

assertObjectMatch({ foo: "bar" }, { foo: "bar" }); // Doesn't throw
assertObjectMatch({ foo: "bar" }, { foo: "baz" }); // Throws

Parameters

actual: Record<PropertyKey, any>
expected: Record<PropertyKey, unknown>
optional
msg: string