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

Function mayExtend

ark/schema/generic.ts:389–396  ·  view source on GitHub ↗
(l: BaseRoot, r: BaseRoot)

Source from the content-addressed store, hash-verified

387const maxOpenArgumentsLength = 1_000_000
388
389const mayExtend = (l: BaseRoot, r: BaseRoot): boolean => {
390 if (!l.hasAlias && !r.hasAlias) return false
391 const intersection = l.intersect(r, false)
392 return (
393 !(intersection instanceof Disjoint) &&
394 isMutuallySimulated(l, intersection, false)
395 )
396}
397
398// as arktype's writeInvalidGenericArgCountMessage writes it for an
399// instantiation in a string, like box<a, b>, which is checked as it's parsed

Callers 1

checkArgsMethod · 0.85

Calls 2

isMutuallySimulatedFunction · 0.90
intersectMethod · 0.80

Tested by

no test coverage detected