MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / findExistImage

Function findExistImage

libs/echarts/echarts.simple.js:7501–7509  ·  view source on GitHub ↗

* @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image

(newImageOrSrc)

Source from the content-addressed store, hash-verified

7499 * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image
7500 */
7501function findExistImage(newImageOrSrc) {
7502 if (typeof newImageOrSrc === 'string') {
7503 var cachedImgObj = globalImageCache.get(newImageOrSrc);
7504 return cachedImgObj && cachedImgObj.image;
7505 }
7506 else {
7507 return newImageOrSrc;
7508 }
7509}
7510
7511/**
7512 * Caution: User should cache loaded images, but not just count on LRU.

Callers 1

parseRichTextFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected