Skip to content

assertcheck v1.0.0


assertcheck / assert / containsSubset

Function: containsSubset() ​

ts
function containsSubset<T>(
   obj, 
   subset, 
   opts?): void;

Defined in: src/assert.ts:1640

Asserts that obj contains all key-value pairs in subset.

Type Parameters ​

Type Parameter
T extends object

Parameters ​

ParameterType
objT
subsetPartial<T>
opts?Opts

Returns ​

void

Example ​

ts
`assert.containsSubset(user, { role: "admin" }, "user must be admin")`

Released under the Apache 2.0 License. Built by Vagabond Studio — senior-only for growing companies.