import { ObjectAsserter } from "https://deno.land/x/typeguardkit@0.33.0/mod.ts";
An ObjectAsserter
is an Asserter
for the object type defined by its
propertyAsserters
.
The provided propertyAsserters
are made accessible as a property of the
created ObjectAsserter
.
Example:
import { _string, Asserted, ObjectAsserter, option } from "typeguardkit";
export const _User = new ObjectAsserter("User", {
name: _string,
emailAddress: option(_string),
});
export type User = Asserted<typeof _User>;
Constructors
new
ObjectAsserter(typeName: string, propertyAsserters: PropertyAsserters)Type Parameters
PropertyAsserters extends Record<string, Asserter<unknown>>
Methods
assert(value: unknown, valueName?: string): AssertedObject<PropertyAsserters>