* Returns the estimated size for the requested source type. * @param {string=} type the source type for which the size should be estimated * @returns {number} the estimated size of the module (must be non-zero)
(type)
| 2197 | * @returns {number} the estimated size of the module (must be non-zero) |
| 2198 | */ |
| 2199 | size(type) { |
| 2200 | const cachedSize = |
| 2201 | this._sourceSizes === undefined ? undefined : this._sourceSizes.get(type); |
| 2202 | if (cachedSize !== undefined) { |
| 2203 | return cachedSize; |
| 2204 | } |
| 2205 | const size = Math.max( |
| 2206 | 1, |
| 2207 | /** @type {Generator} */ (this.generator).getSize(this, type) |
| 2208 | ); |
| 2209 | if (this._sourceSizes === undefined) { |
| 2210 | this._sourceSizes = new Map(); |
| 2211 | } |
| 2212 | this._sourceSizes.set(type, size); |
| 2213 | return size; |
| 2214 | } |
| 2215 | |
| 2216 | /** |
| 2217 | * Adds the provided file dependencies to the module. |
no test coverage detected