Function unreachable

  • Use this to assert unreachable code.

    Parameters

    • Optionalmsg: string

      Optional message to include in the error.

    Returns never

    Never returns, always throws.

    import { unreachable } from "@std/assert";

    unreachable(); // Throws