Skip to main content
Module

x/typeguardkit/mod.ts>PartialAsserter

A TypeScript module to help construct type assertion functions and type guards.
Latest
class PartialAsserter
Re-export
import { PartialAsserter } from "https://deno.land/x/typeguardkit@0.32.1/mod.ts";

A PartialAsserter is an ObjectAsserter for the asserted type of the provided ObjectAsserter with all properties set to optional.

Example:

import {
  _string,
  Asserted,
  ObjectAsserter,
  PartialAsserter,
} from "typeguardkit";

export const _Options = new PartialAsserter(
  "Options",
  {
    option1: _string,
    option2: _string,
    option3: _string,
  },
);

export type Options = Asserted<typeof _Options>;

Constructors

new
PartialAsserter(typeName: string, asserterOrPropertyAsserters: ObjectAsserter<PropertyAsserters> | PropertyAsserters)

Type Parameters

PropertyAsserters extends Record<string, Asserter<unknown>>