* Loads a file or resource URI asynchronously * * @param {Uri} uri the file or resource URI to load * @returns {Promise }
(uri)
| 250 | * @returns {Promise<string>} |
| 251 | */ |
| 252 | loadURIAsync(uri) { |
| 253 | if (uri.scheme) { |
| 254 | const loader = this.schemeHandlers.get(uri.scheme); |
| 255 | |
| 256 | if (loader) |
| 257 | return loader.loadAsync(uri); |
| 258 | } |
| 259 | |
| 260 | if (uri.scheme === 'file' || uri.scheme === 'resource') |
| 261 | return loadResourceOrFileAsync(uri.uri); |
| 262 | |
| 263 | throw new ImportError(`Unsupported URI scheme for importing: ${uri.scheme ?? uri}`); |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | const moduleLoader = new ModuleLoader(moduleGlobalThis); |
no test coverage detected