MCPcopy
hub / github.com/webpack/webpack / create

Method create

lib/stats/StatsFactory.js:248–261  ·  view source on GitHub ↗

* Returns created object. * @template FactoryData * @template FallbackCreatedObject * @param {string} type type * @param {FactoryData} data factory data * @param {Omit<StatsFactoryContext, "type">} baseContext context used as base * @returns {CreatedObject<FactoryData, FallbackCreatedObj

(type, data, baseContext)

Source from the content-addressed store, hash-verified

246 * @returns {CreatedObject<FactoryData, FallbackCreatedObject>} created object
247 */
248 create(type, data, baseContext) {
249 if (this._inCreate) {
250 return this._create(type, data, baseContext);
251 }
252 try {
253 this._inCreate = true;
254 return this._create(type, data, baseContext);
255 } finally {
256 for (const key of Object.keys(this._caches)) {
257 this._caches[/** @type {keyof StatsFactoryHooks} */ (key)].clear();
258 }
259 this._inCreate = false;
260 }
261 }
262
263 /**
264 * Returns created object.

Callers 9

deserializeMethod · 0.45
applyMethod · 0.45
_createMethod · 0.45
mapObjectFunction · 0.45
mergeToObjectFunction · 0.45
sumSizeFunction · 0.45
mimeTypes.jsFile · 0.45

Calls 3

_createMethod · 0.95
keysMethod · 0.65
clearMethod · 0.45

Tested by

no test coverage detected