MCPcopy
hub / github.com/markmap/markmap / wrapFunction

Function wrapFunction

packages/markmap-common/src/util.ts:35–40  ·  view source on GitHub ↗
(
  fn: (...args: T) => U,
  wrapper: (fn: (...args: T) => U, ...args: T) => U,
)

Source from the content-addressed store, hash-verified

33}
34
35export function wrapFunction<T extends unknown[], U>(
36 fn: (...args: T) => U,
37 wrapper: (fn: (...args: T) => U, ...args: T) => U,
38) {
39 return (...args: T) => wrapper(fn, ...args);
40}
41
42export function defer<T = void>() {
43 const obj: Partial<IDeferred<T>> = {};

Callers 3

transformFunction · 0.90
transformFunction · 0.90
transformFunction · 0.90

Calls

no outgoing calls

Tested by 1

transformFunction · 0.72