Switches on key in object, with default fallback

  • Type Parameters

    • T

    Parameters

    • k: string

      Key to look up

    • m: Record<string, T>

      Object with values and optional default

    Returns T

    Value at key or default value