(source: string)
| 57 | } |
| 58 | |
| 59 | private async loadFromSource(source: string): Promise<unknown> { |
| 60 | if (source.startsWith("http://") || source.startsWith("https://")) { |
| 61 | const response = await axios.get(source, { responseType: "text" }); |
| 62 | return this.parseSpec(response.data, source); |
| 63 | } |
| 64 | |
| 65 | const raw = this.fs.readFileSync(source, "utf-8"); |
| 66 | return this.parseSpec(raw, source); |
| 67 | } |
| 68 | |
| 69 | private async loadDocument(source: string, rawDocCache: Map<string, unknown>): Promise<unknown> { |
| 70 | if (rawDocCache.has(source)) { |
no test coverage detected