Creates a TypeofTypeGuard that uses the typeof operator for validation.
TypeofTypeGuard
typeof
The typeof result to check for
The expected typeof result
A type guard that checks typeof value === result
typeof value === result
const isString = isTypeof("string");isString("hello"); // trueisString(123); // false Copy
const isString = isTypeof("string");isString("hello"); // trueisString(123); // false
Creates a
TypeofTypeGuardthat uses thetypeofoperator for validation.