MCPcopy
hub / github.com/oblador/react-native-vector-icons / getImageSource

Function getImageSource

packages/common/src/get-image-source.ts:44–56  ·  view source on GitHub ↗
(
  imageSourceCache: ReturnType<typeof createIconSourceCache>,
  fontReference: string,
  glyph: string,
  options?: GetImageSourceOptions,
)

Source from the content-addressed store, hash-verified

42};
43
44export const getImageSource = async (
45 imageSourceCache: ReturnType<typeof createIconSourceCache>,
46 fontReference: string,
47 glyph: string,
48 options?: GetImageSourceOptions,
49) => {
50 const { cacheKey, cached, nativeOptions } = resolveOptions(imageSourceCache, fontReference, glyph, options);
51 if (cached !== undefined) return cached;
52
53 const value = await ensureGetImageAvailable().getImageForFont(glyph, nativeOptions);
54 imageSourceCache.setValue(cacheKey, value);
55 return value;
56};

Callers

nothing calls this directly

Calls 3

ensureGetImageAvailableFunction · 0.90
resolveOptionsFunction · 0.85
getImageForFontMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…