Checks if assertion is valid and returns value with type inferred from the assertion.
Assertion to be checked.
Value to be passed into assertion.
parse(number, 1); // 1parse(number, "nope"); // Error: number Copy
parse(number, 1); // 1parse(number, "nope"); // Error: number
Checks if assertion is valid and returns value with type inferred from the assertion.