MCPcopy Create free account
hub / github.com/Effect-TS/effect / match

Function match

packages/effect/src/Schema.ts:6315–6329  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6313 }
6314
6315 function match() {
6316 if (arguments.length === 1) {
6317 const cases = arguments[0]
6318 return function(value: any) {
6319 const key = value[tag]
6320 const handler = Object.hasOwn(cases, key) ? cases[key] : undefined
6321 return handler(value)
6322 }
6323 }
6324 const value = arguments[0]
6325 const cases = arguments[1]
6326 const key = value[tag]
6327 const handler = Object.hasOwn(cases, key) ? cases[key] : undefined
6328 return handler(value)
6329 }
6330 }
6331}
6332

Callers

nothing calls this directly

Calls 1

handlerFunction · 0.50

Tested by

no test coverage detected