I like the tricks :) – Kasia
Object is prolly not the right type you want.
const aNaN: Object = NaN // ⛔️ No type error const a1: Object = 1 // ⛔️ No type error const aObject: Object = { a: 1 } // ✅ No type error
type Obj = Record<string, unknown> // or // type Obj = { [key: string]: unknown } const aNaN: Obj = NaN // ✅ Type error const a1: Obj = 1 // ✅ Type error const aObject: Obj = { a: 1 } // ✅ No type error
Crafted with 💛 by Riccardo