MCPcopy
hub / github.com/webpack/tapable / for

Method for

lib/HookMap.js:23–39  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

21 }
22
23 for(key) {
24 // Hot path: inline the map lookup to skip the `this.get(key)`
25 // indirection. This gets hit on every hook access in consumers
26 // like webpack.
27 const map = this._map;
28 const hook = map.get(key);
29 if (hook !== undefined) {
30 return hook;
31 }
32 let newHook = this._factory(key);
33 const interceptors = this._interceptors;
34 for (let i = 0; i < interceptors.length; i++) {
35 newHook = interceptors[i].factory(key, newHook);
36 }
37 map.set(key, newHook);
38 return newHook;
39 }
40
41 intercept(interceptor) {
42 this._interceptors.push(

Callers 3

registerFunction · 0.95
HookMap.jsFile · 0.80
HookMap.test.jsFile · 0.80

Calls 1

getMethod · 0.80

Tested by

no test coverage detected