salve-annos
Version:
A fork with support for documentation of Salve, a Javascript library which implements a validator able to validate an XML document on the basis of a subset of RelaxNG.
26 lines • 935 B
JavaScript
;
/**
* Facilities for loading resources.
*
* @author Louis-Dominique Dubeau
* @license MPL 2.0
* @copyright Mangalam Research Center for Buddhist Languages
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeResourceLoader = makeResourceLoader;
// tslint:disable-next-line:no-typeof-undefined
if (typeof fetch === "undefined") {
throw new Error("all resource loaders require fetch to be available");
}
function makeResourceLoader() {
// tslint:disable-next-line:no-typeof-undefined
if (typeof window === "undefined") {
// tslint:disable-next-line:no-require-imports
const node = require("./resource-loaders/node");
return new node.NodeResourceLoader();
}
// tslint:disable-next-line:no-require-imports
const fetch = require("./resource-loaders/fetch");
return new fetch.FetchResourceLoader();
}
//# sourceMappingURL=resource-loader.js.map