(name: string, data: any)
| 38 | }; |
| 39 | |
| 40 | const 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 | |
| 59 | export const getUrl = (i: Icon) => { |
| 60 | let url = getSrc(i.src); |
no test coverage detected
searching dependent graphs…