MCPcopy
hub / github.com/meteor/meteor / wrap

Function wrap

tools/utils/func-utils.ts:58–73  ·  view source on GitHub ↗
(wrapper: TWrapper, wrapped: TWrapped)

Source from the content-addressed store, hash-verified

56};
57
58function wrap<
59 TWrapper extends AnyFunction,
60 TWrapped extends AnyFunction,
61>(wrapper: TWrapper, wrapped: TWrapped): TWrapper {
62 // Allow the wrapper to be used as a constructor function, just in case
63 // the wrapped function was meant to be used as a constructor.
64 wrapper.prototype = wrapped.prototype;
65
66 // https://medium.com/@cramforce/on-the-awesomeness-of-fn-displayname-9511933a714a
67 const name = wrapped.displayName || wrapped.name;
68 if (name) {
69 wrapper.displayName = name;
70 }
71
72 return wrapper;
73}

Callers 8

coalesceFunction · 0.70
bundler.jsFile · 0.50
ResolverClass · 0.50
constructorMethod · 0.50
import-scanner.tsFile · 0.50
makeOptimisticFunction · 0.50
optimistic.tsFile · 0.50
makeCheapPathFunctionFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…