(test, module)
| 158 | * @returns {boolean | null | string} true, if the module should be selected |
| 159 | */ |
| 160 | const checkTest = (test, module) => { |
| 161 | if (test === undefined) return true; |
| 162 | if (typeof test === "function") { |
| 163 | return test(module); |
| 164 | } |
| 165 | if (typeof test === "string") { |
| 166 | const name = module.nameForCondition(); |
| 167 | return name && name.startsWith(test); |
| 168 | } |
| 169 | if (test instanceof RegExp) { |
| 170 | const name = module.nameForCondition(); |
| 171 | return name && test.test(name); |
| 172 | } |
| 173 | return false; |
| 174 | }; |
| 175 | |
| 176 | class LazyCompilationDependency extends Dependency { |
| 177 | /** |
no test coverage detected