MCPcopy Create free account
hub / github.com/arktypeio/arktype / intersect

Function intersect

ark/sets/algebra.ts:18–22  ·  view source on GitHub ↗
(...schemas: Schema[])

Source from the content-addressed store, hash-verified

16
17/** the values every schema accepts: never if they're disjoint, unknown if there are none */
18export const intersect = (...schemas: Schema[]): Root =>
19 schemas.reduce<Root>(
20 (result, schema) => result.intersect(parse(schema)).toNeverIfDisjoint(),
21 $ark.kw.unknown
22 )
23
24/** the values any schema accepts, without the branches others subsume */
25export const union = (...schemas: Schema[]): Root =>

Callers 1

algebra.test.tsFile · 0.50

Calls 4

parseFunction · 0.90
reduceMethod · 0.80
toNeverIfDisjointMethod · 0.80
intersectMethod · 0.80

Tested by

no test coverage detected