MCPcopy Index your code
hub / github.com/MALSync/MALSync / conditionalMethod

Function conditionalMethod

src/pages-chibi/implementations/bato/main.ts:57–67  ·  view source on GitHub ↗
(
  condition: (c: ChibiGenerator<any>) => ChibiJson<boolean>,
  method1,
  method2,
)

Source from the content-addressed store, hash-verified

55}
56
57function conditionalMethod(
58 condition: (c: ChibiGenerator<any>) => ChibiJson<boolean>,
59 method1,
60 method2,
61) {
62 const temp1 = method1;
63 const temp2 = method2;
64 return ($c: ChibiGenerator<any>) => {
65 return $c.if(condition($c), temp1, temp2).run();
66 };
67}
68
69export const bato: PageInterface = conditionalPageInterfaces(
70 ($c: ChibiGenerator<any>) => $c.querySelector('a.position-absolute > small').boolean().run(),

Callers 1

Calls 2

conditionFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected