Skip to main content
Deno 2 is finally here 🎉️
Learn more
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.33.0/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>>