All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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"]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy