MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / wrap

Function wrap

__tests__/explore-long-query.test.ts:41–41  ·  view source on GitHub ↗
(fn: T)

Source from the content-addressed store, hash-verified

39 const stmt = prepare(sql);
40 if (!pattern.test(sql)) return stmt;
41 const wrap = <T extends (...a: any[]) => any>(fn: T): T => ((...args: any[]) => { counter.count++; return fn(...args); }) as T;
42 return { ...stmt, all: wrap(stmt.all.bind(stmt)), get: wrap(stmt.get.bind(stmt)), iterate: wrap(stmt.iterate.bind(stmt)), run: stmt.run.bind(stmt) };
43 });
44 return counter;

Callers 1

countStatementsFunction · 0.85

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected