* Reports whether a module has a stored result for the requested runtime, or * a single unambiguous result when no runtime is specified. * @param {Module} module the module * @param {RuntimeSpec} runtime runtime(s) * @returns {boolean} true, when we have data for this
(module, runtime)
| 92 | * @returns {boolean} true, when we have data for this |
| 93 | */ |
| 94 | has(module, runtime) { |
| 95 | const entry = this.map.get(module); |
| 96 | if (entry === undefined) { |
| 97 | return false; |
| 98 | } |
| 99 | if (runtime !== undefined) { |
| 100 | return entry.has(runtime); |
| 101 | } else if (entry.size > 1) { |
| 102 | const results = new Set(entry.values()); |
| 103 | return results.size === 1; |
| 104 | } |
| 105 | return entry.size === 1; |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Returns a generated source of the requested source type from a stored code |