The file `source.ts` contains a TypeScript module that threads nullable and
optional values through optional chaining, nullish-coalescing fallbacks, and a
small generic cache.

Convert it to idiomatic Flow in `main.js`, preserving the runtime behavior and
the nullability of every value. The result must pass `flow check` with zero
errors.
