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

Function getSrc

src/components/icon/utils.ts:146–154  ·  view source on GitHub ↗
(src: string | undefined)

Source from the content-addressed store, hash-verified

144};
145
146export const getSrc = (src: string | undefined) => {
147 if (isStr(src)) {
148 src = src.trim();
149 if (isSrc(src)) {
150 return src;
151 }
152 }
153 return null;
154};
155
156export const isSrc = (str: string) => str.length > 0 && /(\/|\.)/.test(str);
157

Callers 2

utils.spec.tsFile · 0.90
getUrlFunction · 0.85

Calls 2

isStrFunction · 0.85
isSrcFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…