MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / incr

Method incr

src/app/cache.ts:175–181  ·  view source on GitHub ↗
(key: string, increase: number)

Source from the content-addressed store, hash-verified

173 }
174
175 incr(key: string, increase: number): Promise<number> {
176 return this.tx(key, (value: number | undefined, tx) => {
177 value = (value || 0) + increase;
178 tx.set(value);
179 return value;
180 });
181 }
182}
183
184export type ICacheSet<T> = (result: T | undefined) => Promise<T | undefined> | T | undefined;

Callers 1

cache.test.tsFile · 0.80

Calls 2

txMethod · 0.95
setMethod · 0.65

Tested by

no test coverage detected