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

Method unionKindOf

ark/aot/graph.ts:2250–2275  ·  view source on GitHub ↗
(
		types: readonly (TSType | TSTypeAnnotation | null)[],
		context: TypeContext,
		module: SourceModule,
		kindOfKey: KindOfKey,
		depth: number,
		typeArgs: TypeArgs | undefined,
		state: TypeEvalState
	)

Source from the content-addressed store, hash-verified

2248 }
2249
2250 private unionKindOf(
2251 types: readonly (TSType | TSTypeAnnotation | null)[],
2252 context: TypeContext,
2253 module: SourceModule,
2254 kindOfKey: KindOfKey,
2255 depth: number,
2256 typeArgs: TypeArgs | undefined,
2257 state: TypeEvalState
2258 ): KindBits | undefined {
2259 let result: KindBits = kinds.data
2260 for (const t of types) {
2261 if (!t) continue
2262 const kind = this.typeKindOf(
2263 t,
2264 context,
2265 module,
2266 kindOfKey,
2267 depth,
2268 typeArgs,
2269 state
2270 )
2271 if (kind === undefined) return
2272 result |= kind
2273 }
2274 return result
2275 }
2276
2277 // e.g. `typeof def & { in: unknown }`, a Type only if some part says so
2278 private intersectionKindOf(

Callers 2

unionMethod · 0.95
namedTypeKindOfMethod · 0.95

Calls 1

typeKindOfMethod · 0.95

Tested by

no test coverage detected