const { a }: { a: string } & ({ b: number } | { c: number } | {}) = params
const value = 'b' in params ? params.b : 'c' in params ? params.c : null
// incorrect fixed
const { a, b, c }: { a: string } & ({ b: number } | { c: number } | {}) = params
const value = 'b' in params ? b : 'c' in params ? c : null
The fixed codes is not runnable anymore. Playground
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too