Skip to content

Welshman Docs / @welshman/lib / switcher

Function: switcher() ​

switcher<T>(k, m): T

Defined in: packages/lib/src/Tools.ts:1101

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