MCPcopy
hub / github.com/callstack/react-native-paper / isImageSource

Function isImageSource

src/components/Icon.tsx:29–41  ·  view source on GitHub ↗
(source: any)

Source from the content-addressed store, hash-verified

27};
28
29const isImageSource = (source: any) =>
30 // source is an object with uri
31 (typeof source === 'object' &&
32 source !== null &&
33 Object.prototype.hasOwnProperty.call(source, 'uri') &&
34 typeof source.uri === 'string') ||
35 // source is a module, e.g. - require('image')
36 typeof source === 'number' ||
37 // image url on web
38 (Platform.OS === 'web' &&
39 typeof source === 'string' &&
40 (source.startsWith('data:image') ||
41 /\.(bmp|jpg|jpeg|png|gif|svg)$/.test(source)));
42
43const getIconId = (source: any) => {
44 if (

Callers 2

isValidIconFunction · 0.85
IconFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…