MCPcopy
hub / github.com/ionic-team/ionicons / addToIconMap

Function addToIconMap

src/components/icon/utils.ts:40–57  ·  view source on GitHub ↗
(name: string, data: any)

Source from the content-addressed store, hash-verified

38};
39
40const addToIconMap = (name: string, data: any) => {
41 const map = getIconMap();
42
43 const existingIcon = map.get(name);
44
45 if (existingIcon === undefined) {
46 map.set(name, data);
47
48 /**
49 * Importing and defining the same icon reference
50 * multiple times should not yield a warning.
51 */
52 } else if (existingIcon !== data) {
53 console.warn(
54 `[Ionicons Warning]: Multiple icons were mapped to name "${name}". Ensure that multiple icons are not mapped to the same icon name.`,
55 );
56 }
57};
58
59export const getUrl = (i: Icon) => {
60 let url = getSrc(i.src);

Callers 1

addIconsFunction · 0.85

Calls 1

getIconMapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…