Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const getIconPath = (iconName, direction = 'ltr') => {
pathPrefix = pathPrefix !== undefined ? pathPrefix : getPathPrefix();
if (isValidName(iconName)) {
const baseIconPath = getBaseIconPath(getCategory(iconName), direction);
if (baseIconPath) {
if (isIframeInEdge) {
const origin = `${window.location.protocol}//${window.location.host}`;
return `${origin}${pathPrefix}${baseIconPath}#${getName(
iconName
)}`;
}
return `${pathPrefix}${baseIconPath}#${getName(iconName)}`;
}
}
return '';
};