import { partial } from "https://deno.land/x/typeguardkit@0.33.0/mod.ts";
partial
can be used to create a PartialAsserter
without specifying a
typeName
.
Example:
import { _string, Asserted, ObjectAsserter, partial } from "typeguardkit";
// types/user_name.ts
export const _UserName = new ObjectAsserter("UserName", {
firstName: _string,
lastName: _string,
});
export type UserName = Asserted<typeof _UserName>;
// types/user_name_update.ts
export const _UserNameUpdate = partial(_UserName);
export type UserNameUpdate = Asserted<typeof _UserNameUpdate>;
Type Parameters
PropertyAsserters extends Record<string, Asserter<unknown>>
Parameters
asserter: ObjectAsserter<PropertyAsserters>