Function assertExhaustive

  • Use in the default case of a switch that you want to be fully exhaustive. Using this function forces the compiler to enforce exhaustivity during compile-time.

    Example

    const number = 1;
    switch (number) {
    case 0:
    ...
    case 1:
    ...
    default:
    assertExhaustive(snapPrefix);
    }

    Parameters

    • _object: never

      The object on which the switch is being operated.

    Returns never