()
| 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); |
nothing calls this directly
no test coverage detected