sudovanilla-website/public/@shoelace-style/shoelace/cdn/chunks/chunk.XNEONNEJ.js

24 lines
571 B
JavaScript
Raw Normal View History

2024-05-13 22:34:06 -05:00
// 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
};