@kayahr/assert
    Preparing search index...

    Function assertInstanceOf

    • Asserts that given value is an instance of the given class.

      Type Parameters

      • T

      Parameters

      • value: unknown

        The value to check.

      • type: Class<T>

        The class the value must be an instance of.

      • Optionalreason: string

        Optional reason added to exception message when assertion fails.

      Returns asserts value is T

      AssertionError when value is not an instance of the given class.