Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.dist.prod.util.FetchHelper.js.map Maven / Gradle / Ivy
{
"version": 3,
"sources": ["../../../src/util/FetchHelper.ts"],
"sourcesContent": ["const fetchPromises = new Map>();\nconst jsonPromises = new Map>();\nconst textPromises = new Map>();\n\nconst fetchTextOnce = async (url: string) => {\n\tif (!fetchPromises.get(url)) {\n\t\tfetchPromises.set(url, fetch(url));\n\t}\n\tconst response = await fetchPromises.get(url);\n\n\tif (response && !textPromises.get(url)) {\n\t\ttextPromises.set(url, response.text());\n\t}\n\n\treturn textPromises.get(url);\n};\n\nconst fetchJsonOnce = async (url: string) => {\n\tif (!fetchPromises.get(url)) {\n\t\tfetchPromises.set(url, fetch(url));\n\t}\n\tconst response = await fetchPromises.get(url);\n\n\tif (response && !jsonPromises.get(url)) {\n\t\tjsonPromises.set(url, response.json());\n\t}\n\n\treturn jsonPromises.get(url);\n};\n\nexport { fetchTextOnce, fetchJsonOnce };\n"],
"mappings": "aAAA,MAAMA,EAAgB,IAAI,IACpBC,EAAe,IAAI,IACnBC,EAAe,IAAI,IAEnBC,EAAgB,MAAOC,GAAgB,CACvCJ,EAAc,IAAII,CAAG,GACzBJ,EAAc,IAAII,EAAK,MAAMA,CAAG,CAAC,EAElC,MAAMC,EAAW,MAAML,EAAc,IAAII,CAAG,EAE5C,OAAIC,GAAY,CAACH,EAAa,IAAIE,CAAG,GACpCF,EAAa,IAAIE,EAAKC,EAAS,KAAK,CAAC,EAG/BH,EAAa,IAAIE,CAAG,CAC5B,EAEME,EAAgB,MAAOF,GAAgB,CACvCJ,EAAc,IAAII,CAAG,GACzBJ,EAAc,IAAII,EAAK,MAAMA,CAAG,CAAC,EAElC,MAAMC,EAAW,MAAML,EAAc,IAAII,CAAG,EAE5C,OAAIC,GAAY,CAACJ,EAAa,IAAIG,CAAG,GACpCH,EAAa,IAAIG,EAAKC,EAAS,KAAK,CAAC,EAG/BJ,EAAa,IAAIG,CAAG,CAC5B,EAEA,OAASD,KAAA,cAAeG,KAAA",
"names": ["fetchPromises", "jsonPromises", "textPromises", "fetchTextOnce", "url", "response", "fetchJsonOnce"]
}