Archived
Template
1
Fork 0
This repository has been archived on 2024-09-04. You can view files and clone it, but cannot push or open issues or pull requests.
Contour/public/@shoelace-style/shoelace/cdn/chunks/chunk.XNEONNEJ.js
2024-01-30 10:59:28 -05:00

23 lines
571 B
JavaScript

// src/components/include/request.ts
var includeFiles = /* @__PURE__ */ new Map();
function requestInclude(src, mode = "cors") {
const prev = includeFiles.get(src);
if (prev !== void 0) {
return Promise.resolve(prev);
}
const fileDataPromise = fetch(src, { mode }).then(async (response) => {
const res = {
ok: response.ok,
status: response.status,
html: await response.text()
};
includeFiles.set(src, res);
return res;
});
includeFiles.set(src, fileDataPromise);
return fileDataPromise;
}
export {
requestInclude
};