MCPcopy
hub / github.com/ashutosh1919/masterPortfolio / findIcon

Function findIcon

src/assets/font-awesome/js/all.js:13311–13351  ·  view source on GitHub ↗
(iconName, prefix)

Source from the content-addressed store, hash-verified

13309 };
13310 }
13311 function findIcon(iconName, prefix) {
13312 return new picked(function (resolve, reject) {
13313 var val = {
13314 found: false,
13315 width: 512,
13316 height: 512,
13317 icon: missing,
13318 };
13319
13320 if (
13321 iconName &&
13322 prefix &&
13323 styles$2[prefix] &&
13324 styles$2[prefix][iconName]
13325 ) {
13326 var icon = styles$2[prefix][iconName];
13327 return resolve(asFoundIcon(icon));
13328 }
13329
13330 var headers = {};
13331
13332 if (
13333 _typeof(WINDOW.FontAwesomeKitConfig) === "object" &&
13334 typeof window.FontAwesomeKitConfig.token === "string"
13335 ) {
13336 headers["fa-kit-token"] = WINDOW.FontAwesomeKitConfig.token;
13337 }
13338
13339 if (iconName && prefix && !config.showMissingIcons) {
13340 reject(
13341 new MissingIcon(
13342 "Icon is missing for prefix "
13343 .concat(prefix, " with icon name ")
13344 .concat(iconName)
13345 )
13346 );
13347 } else {
13348 resolve(val);
13349 }
13350 });
13351 }
13352
13353 var styles$3 = namespace.styles;
13354

Callers 2

replaceForPositionFunction · 0.70

Calls 4

resolveFunction · 0.70
asFoundIconFunction · 0.70
_typeofFunction · 0.70
rejectFunction · 0.70

Tested by

no test coverage detected