MCPcopy Create free account
hub / github.com/microsoft/SandDance / getFetchFunction

Function getFetchFunction

docs/app/js/sanddance-app.js:55766–55777  ·  view source on GitHub ↗
(options, context)

Source from the content-addressed store, hash-verified

55764 return normalizeOptionsInternal(loader, options, url);
55765}
55766function getFetchFunction(options, context) {
55767 var globalOptions = getGlobalLoaderOptions();
55768 var fetch = options.fetch || globalOptions.fetch;
55769 if (typeof fetch === "function") return fetch;
55770 if ((0, _isType.isObject)(fetch)) return function(url) {
55771 return (0, _fetchFile.fetchFile)(url, fetch);
55772 };
55773 if (context && context.fetch) return context.fetch;
55774 return function(url) {
55775 return (0, _fetchFile.fetchFile)(url, options);
55776 };
55777}
55778function validateOptions(options, loaders) {
55779 var log = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : console;
55780 validateOptionsObject(options, null, log, DEFAULT_LOADER_OPTIONS, DEPRECATED_LOADER_OPTIONS, loaders);

Callers

nothing calls this directly

Calls 1

getGlobalLoaderOptionsFunction · 0.70

Tested by

no test coverage detected