Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/lophus/lib/std/assert.ts>assertObjectMatch

Fully-modular TypeScript implementation of the Nostr protocol, oriented to web standards and edge environments
Latest
function assertObjectMatch
import { assertObjectMatch } from "https://deno.land/x/lophus@0.0.13/lib/std/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