MCPcopy
hub / github.com/gvergnaud/ts-pattern / fn2

Function fn2

tests/objects.test.ts:21–27  ·  view source on GitHub ↗
(obj: Input)

Source from the content-addressed store, hash-verified

19 };
20
21 const fn2 = (obj: Input) => {
22 if (isMatching({ [symbolA]: { [symbolB]: 'bar' } }, obj)) {
23 const value = obj[symbolA][symbolB];
24 type t = Expect<Equal<typeof value, 'bar'>>;
25 throw new Error('Expected obj to not match the bar pattern!');
26 }
27 };
28
29 fn1({
30 [symbolA]: { [symbolB]: 'foo' },

Callers 1

objects.test.tsFile · 0.70

Calls 5

isMatchingFunction · 0.90
matchFunction · 0.90
exhaustiveMethod · 0.80
withMethod · 0.80
selectMethod · 0.80

Tested by

no test coverage detected