Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save edezekiel/6375fc2eb01e690bbfc5c45c9a102695 to your computer and use it in GitHub Desktop.
Save edezekiel/6375fc2eb01e690bbfc5c45c9a102695 to your computer and use it in GitHub Desktop.
Type safety issues when using Record<string, any>
function parseObject(obj: Record<string, any>) {
let doesNotExist = obj['doesNotExist']; // ok maybe it's not so bad
doesNotExist.toString(); // yikes
doesNotExist += 100; // double yikes
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment