Prevents inference of a type parameter T.
T
🦴 utilities
original version author
function assertEqual<T>(a: T, b: NoInfer<T>) { return a === b}assertEqual(123, 324) // OKassertEqual(123, 'abc') // ErrorassertEqual({ x: 1 }, { x: 1, y: 2 }) // Error Copy
function assertEqual<T>(a: T, b: NoInfer<T>) { return a === b}assertEqual(123, 324) // OKassertEqual(123, 'abc') // ErrorassertEqual({ x: 1 }, { x: 1, y: 2 }) // Error
A build-in NoInfer is coming soon.
NoInfer
Prevents inference of a type parameter
T
.🦴 utilities