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

Method getName

packager/src/node-haste/Module.js:142–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140 }
141
142 getName(): Promise<string> {
143 return Promise.resolve().then(() => {
144 const name = this._getHasteName();
145 if (name != null) {
146 return name;
147 }
148
149 const p = this.getPackage();
150
151 if (!p) {
152 // Name is full path
153 return this.path;
154 }
155
156 return p.getName()
157 .then(packageName => {
158 if (!packageName) {
159 return this.path;
160 }
161
162 return joinPath(packageName, relativePath(p.root, this.path)).replace(/\\/g, '/');
163 });
164 });
165 }
166
167 getPackage() {
168 return this._moduleCache.getPackageForModule(this);

Callers

nothing calls this directly

Calls 6

_getHasteNameMethod · 0.95
getPackageMethod · 0.95
replaceMethod · 0.80
resolveMethod · 0.65
getNameMethod · 0.65
thenMethod · 0.45

Tested by

no test coverage detected