Skip to content

Instantly share code, notes, and snippets.

@edezekiel
Last active September 8, 2023 12:38
Show Gist options
  • Save edezekiel/81bb1089765ee615e46f00b08bbaca80 to your computer and use it in GitHub Desktop.
Save edezekiel/81bb1089765ee615e46f00b08bbaca80 to your computer and use it in GitHub Desktop.
parseObject function expected to error when invoked with interface
import { Hero } from 'third-party-library'
const hero: Hero = { name: 'codey' };
function parseObject<T>(obj: Record<string, unknown>) {
return JSON.stringify(obj);
}
parseObject(hero); // Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment