* If a custom Haste implementation is provided, then we use it to determine * the actual Haste name instead of "@providesModule". * `enforceHasteNameMatches` has been added to that it is easier to * transition from a system using "@providesModule" to a system using another * custom syste
()
| 216 | * the "@providesModule" name (ex. "foo"). |
| 217 | */ |
| 218 | _readHasteName(): ?string { |
| 219 | const hasteImpl = this._options.hasteImpl; |
| 220 | if (hasteImpl == null) { |
| 221 | return this._readHasteNameFromDocBlock(); |
| 222 | } |
| 223 | const {enforceHasteNameMatches} = hasteImpl; |
| 224 | if (enforceHasteNameMatches != null) { |
| 225 | const name = this._readHasteNameFromDocBlock(); |
| 226 | enforceHasteNameMatches(this.path, name || undefined); |
| 227 | } |
| 228 | return hasteImpl.getHasteName(this.path); |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * We extract the Haste name from the `@providesModule` docbloc field. This is |
no test coverage detected