@loaders.gl/core
Version:
Framework-independent loaders for 3D graphics formats
36 lines (32 loc) • 1.17 kB
JavaScript
import _regeneratorRuntime from "@babel/runtime/regenerator";
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
import { isFileReadable } from '../../javascript-utils/is-type';
import { resolvePath } from './file-aliases';
import fetchFileReadable from './fetch-file.browser';
export function fetchFile(_x, _x2) {
return _fetchFile.apply(this, arguments);
}
function _fetchFile() {
_fetchFile = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(url, options) {
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (!isFileReadable(url)) {
_context.next = 2;
break;
}
return _context.abrupt("return", fetchFileReadable(url, options));
case 2:
url = resolvePath(url);
return _context.abrupt("return", fetch(url, options));
case 4:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return _fetchFile.apply(this, arguments);
}
//# sourceMappingURL=fetch-file.js.map