User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
1mo
{} doesn't mean an empty object, but means any types other than null and undefined
If you want a type that means "empty object", use Record<PropertyKey, never> instead (deno-lint ban-types)
The thing that has always irked me with the TypeScript ecosystem is that this advice is fucking wrong. {} sometimes does mean empty record, and there's no substitute for it. Record<PropertyKey, never> gets me an error, and Record<PropertyKey, unknown> allows too much.