improve typeCheck utility (#239890)

This commit is contained in:
Oleg Solomko
2025-02-06 23:02:13 -08:00
committed by GitHub
parent ea1cad71f2
commit 86bc5fa3b5
+2 -3
View File
@@ -202,10 +202,9 @@ export function assertOneOf<TType, TSubtype extends TType>(
}
/**
* Simple compile-time type check function to validate a type of
* a provided object.
* Compile-time type check of a variable.
*/
export function typeCheck<T extends unknown>(_thing: T): asserts _thing is T { }
export function typeCheck<T = never>(_thing: NoInfer<T>): void { }
const hasOwnProperty = Object.prototype.hasOwnProperty;