Boolean indirection (const stateOnly = ...; if (stateOnly)) didn't carry the narrowing to body.state inside the branch. Inline the check so TypeScript narrows correctly and the explicit cast on pendingState becomes unnecessary.
Boolean indirection (const stateOnly = ...; if (stateOnly)) didn't carry the narrowing to body.state inside the branch. Inline the check so TypeScript narrows correctly and the explicit cast on pendingState becomes unnecessary.