(contentKey: string)
| 295 | } |
| 296 | |
| 297 | parseContentKey(contentKey: string) { |
| 298 | if (!this.useOpenAuthoring) { |
| 299 | return parseContentKey(contentKey); |
| 300 | } |
| 301 | |
| 302 | const repoPrefix = `${this.repo}/`; |
| 303 | // Some content keys may be prefixed with the origin repo instead of the fork repo. |
| 304 | const originRepoPrefix = this.originRepo ? `${this.originRepo}/` : null; |
| 305 | |
| 306 | let keyToParse = contentKey; |
| 307 | |
| 308 | if (contentKey.startsWith(repoPrefix)) { |
| 309 | keyToParse = contentKey.slice(repoPrefix.length); |
| 310 | } else if (originRepoPrefix && contentKey.startsWith(originRepoPrefix)) { |
| 311 | keyToParse = contentKey.slice(originRepoPrefix.length); |
| 312 | } |
| 313 | |
| 314 | return parseContentKey(keyToParse); |
| 315 | } |
| 316 | |
| 317 | async readFile( |
| 318 | path: string, |
no test coverage detected