Skip to main content
Go to Latest
class matches.ShapeParser
implements IParser<A, B>
import { matches } from "https://deno.land/x/embassyd_sdk@v0.3.1.1.4/mod.ts";
const { ShapeParser } = matches;

Given an object, we want to make sure the key exists and that the value on the key matches the parser

Constructors

new
ShapeParser(
parserMap: [key in keyof B]: Parser<unknown, B[key]>,
isPartial: boolean,
parserKeys?,
description?,
)

Type Parameters

A extends unknown
Key extends string | number | symbol
B

Methods

parse<C, D>(a: unknown, onParse: OnParse<A, [key in Key]?: B, C, D>): C | D