MCPcopy Create free account
hub / github.com/glideapps/quicktype / nonNullTypeCases

Function nonNullTypeCases

src/Type.ts:412–421  ·  view source on GitHub ↗
(t: Type)

Source from the content-addressed store, hash-verified

410}
411
412export function nonNullTypeCases(t: Type): OrderedSet<Type> {
413 if (t.kind === "null") {
414 return OrderedSet();
415 }
416 if (!(t instanceof UnionType)) {
417 return OrderedSet([t]);
418 }
419 const nonNulls = removeNullFromUnion(t)[1];
420 return OrderedSet(nonNulls);
421}
422
423// FIXME: The outer OrderedSet should be some Collection, but I can't figure out
424// which one. Collection.Indexed doesn't work with OrderedSet, which is unfortunate.

Callers 2

shouldBeMapFunction · 0.90
canBeCombinedFunction · 0.90

Calls 1

removeNullFromUnionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…