MCPcopy Create free account
hub / github.com/GNOME/gjs / loadURIAsync

Method loadURIAsync

modules/internal/loader.js:252–264  ·  view source on GitHub ↗

* Loads a file or resource URI asynchronously * * @param {Uri} uri the file or resource URI to load * @returns {Promise }

(uri)

Source from the content-addressed store, hash-verified

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
267const moduleLoader = new ModuleLoader(moduleGlobalThis);

Callers 1

Calls 1

getMethod · 0.45

Tested by

no test coverage detected