chunk.DTM5B7PO.js 483 B

123456789101112131415161718192021
  1. // src/components/include/request.ts
  2. var includeFiles = new Map();
  3. var requestInclude = async (src, mode = "cors") => {
  4. if (includeFiles.has(src)) {
  5. return includeFiles.get(src);
  6. } else {
  7. const request = fetch(src, { mode }).then(async (response) => {
  8. return {
  9. ok: response.ok,
  10. status: response.status,
  11. html: await response.text()
  12. };
  13. });
  14. includeFiles.set(src, request);
  15. return request;
  16. }
  17. };
  18. export {
  19. requestInclude
  20. };