@w5s/core-typeFunctionsassertTypeassertType CallableassertType<Actual, Expected>(_shouldBeEqual: IsExact<Actual, Expected>): voidRaise a compile error when Actual is not strictly equal to Expected. This is a type helper and does nothing at run time.@exampletype Expected = 'foo'assertType<'foo', Expected>(true);// -> everything is fineassertType<'bar', Expected>(true);// -> ts raises an errorType parametersActualExpected
Raise a compile error when
Actualis not strictly equal toExpected. This is a type helper and does nothing at run time.