Created
May 4, 2022 07:45
-
-
Save safareli/44c87d00d3b317045b6f078ec9938c57 to your computer and use it in GitHub Desktop.
Check that type of record is an empty record in typescript type level
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare const test1: {} | |
declare const test2: {foo: 1} | |
declare const test3: {foo: 1,asda:11} | |
declare const assertRecordIsEmpty:(input: Record<keyof any,never>) => void | |
assertRecordIsEmpty(test1) | |
assertRecordIsEmpty(test2) | |
assertRecordIsEmpty(test3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment