4 ms·
The author doesn’t address a common work-around for Object.keys() which is a type guard. https://www.typescriptlang.org/docs/handbook/advanced-types.html https:
by baerrie 3y ago
The author doesn’t address a common work-around for Object.keys() which is a type guard. https://www.typescriptlang.org/docs/handbook/advanced-types.html https://www.typescriptlang.org/docs/handbook/advanced-types....
- mock-possum 3y agoType guarding is definitely a pain point moving from JS to TS
- baerrie 3y agoFor sure. I think most devs are afraid to add more conditionality but even JS warrants a ton of undefined checks, etc because of the language’s generic nature