import { objectIntersection } from "https://deno.land/x/typeguardkit@0.33.0/mod.ts";
objectIntersection
can be used to create an ObjectIntersectionAsserter
without specifying a typeName
.
Example:
import {
_string,
Asserted,
ObjectAsserter,
objectIntersection,
} from "typeguardkit";
// types/a.ts
export const _A = new ObjectAsserter("A", {
a: _string,
});
export type A = Asserted<typeof _A>;
// types/b.ts
export const _B = new ObjectAsserter("B", {
b: _string,
});
export type B = Asserted<typeof _B>;
// types/c.ts
export const _C = objectIntersection(_A, _B);
export type C = Asserted<typeof _C>;
Parameters
asserterA: ObjectAsserter<PropertyAssertersA>
asserterB: ObjectAsserter<PropertyAssertersB>