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

Function fn1

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

Source from the content-addressed store, hash-verified

10
11 it('should work with symbols', () => {
12 const fn1 = (obj: Input) => {
13 if (isMatching({ [symbolA]: { [symbolB]: 'foo' } }, obj)) {
14 const value = obj[symbolA][symbolB];
15 type t = Expect<Equal<typeof value, 'foo'>>;
16 } else {
17 throw new Error('Expected obj to match the foo pattern!');
18 }
19 };
20
21 const fn2 = (obj: Input) => {
22 if (isMatching({ [symbolA]: { [symbolB]: 'bar' } }, obj)) {

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