Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
function matches.shape
Re-export
import { matches } from "https://deno.land/x/embassyd_sdk@v0.3.3.0.4/mod.ts";
const { shape } = matches;

Type Parameters

A extends { }
Overwrites extends keyof A

Parameters

testShape: [key in keyof A]: Parser<unknown, A[key]>
optionals: Overwrites[]

Returns

Parser<unknown, MergeAll<[K in keyof Omit<A, Overwrites>]: A[K] & [K in keyof Pick<A, Overwrites>]?: A[K]>>

Type Parameters

A extends { }
Overwrites extends keyof A
Defaults extends [K in Overwrites]?: A[K]

Parameters

testShape: [key in keyof A]: Parser<unknown, A[key]>
optionals: Overwrites[]
defaults: Defaults

Returns

Parser<unknown, MergeAll<[K in keyof Omit<A, Overwrites>]: A[K] & [K in keyof Omit<Pick<A, Overwrites>, keyof Defaults>]?: A[K] & [K in keyof Pick<Pick<A, Overwrites>, keyof Defaults & Overwrites>]: A[K]>>

Type Parameters

A extends { }

Parameters

testShape: [key in keyof A]: Parser<unknown, A[key]>

Returns

Parser<unknown, A>