MCPcopy Create free account
hub / github.com/ptmt/react-native-macos / _readHasteName

Method _readHasteName

packager/src/node-haste/Module.js:218–229  ·  view source on GitHub ↗

* 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

()

Source from the content-addressed store, hash-verified

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

Callers 1

_getHasteNameMethod · 0.95

Calls 1

Tested by

no test coverage detected