3 ms·
To be fair, that behavior on typescript's part is a major hole for bugs to slip through. Specifically: absent optional keys + extra keys is fundamentally indis
by o11c 3y ago
To be fair, that behavior on typescript's part is a major hole for bugs to slip through.
Specifically: absent optional keys + extra keys is fundamentally indistinguishable from miseptl keys.
- oivey 3y agoThe current situation is worse, IMO. Lots of code that could be checked cannot, and lots of code that could have a more clearly defined interface does not.
- chuckadams 3y ago`interface` in TS allows extra keys, `type` does do not. Usually best to use `type` and add an intersection with some other type if you want extras (`Record<string,unknown>` is all right for arbitrary extra keys)