I've just upgraded from Angular 7.1.4 to 8.2.0, Typescript 3.1.6 to 3.5.3, RxJS
Before the upgrade, TS correctly identified that this array item is not undefined, but now I'm getting this frustrating compilation error. (note, I'm using lo-dash below, but the same error occurs if I use if (autoCorrectionData[action.algorithmId] !== undefined) {
src/app/state/edit/edit.reducer.ts(417,29): error TS2532: Object is possibly 'undefined'.
How can I get TypeScript to recognize that the Object IS defined after I check using the if
condition?
*edit* This might have something to do with recent changes to NGRX Dictionaries, but I'm not sure why. Dictionary values can now be undefined.