@fortawesome/fontawesome
Advanced tools
Comparing version 1.2.0-1 to 1.2.0-2
@@ -1,2 +0,1 @@ | ||
export as namespace fontawesome; | ||
import {IconDefinition, IconLookup, IconName, IconPrefix, IconPack } from '@fortawesome/fontawesome-common-types'; | ||
@@ -17,20 +16,2 @@ export {IconDefinition, IconLookup, IconName, IconPrefix, IconPack } from '@fortawesome/fontawesome-common-types'; | ||
export function icon(icon: IconName | IconLookup, params?: IconParams): Icon; | ||
declare const api: { | ||
dom: DOM; | ||
library: Library; | ||
parse: { transform(transformString: string): Transform }; | ||
config: Config; | ||
noAuto():void; | ||
findIconDefinition(iconLookup: IconLookup): IconDefinition; | ||
text(content: string, params?: Params): Text; | ||
layer( | ||
assembler: ( | ||
addLayerCallback: (layerToAdd: IconLookup | IconLookup[]) => void | ||
) => void | ||
): Layer; | ||
icon(icon: IconName | IconLookup, params?: IconParams): Icon; | ||
} | ||
export default api; | ||
export type IconProp = IconName | [IconPrefix, IconName] | IconLookup; | ||
@@ -37,0 +18,0 @@ export type FlipProp = "horizontal" | "vertical" | "both"; |
@@ -28,2 +28,3 @@ /*! | ||
var IS_BROWSER = !!WINDOW.document; | ||
var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function'; | ||
var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/'); | ||
@@ -189,3 +190,3 @@ | ||
if (IS_BROWSER) { | ||
if (IS_DOM) { | ||
loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState); | ||
@@ -197,3 +198,3 @@ | ||
var domready = function (fn) { | ||
if (!DOCUMENT) return; | ||
if (!IS_DOM) return; | ||
loaded ? setTimeout(fn, 0) : functions.push(fn); | ||
@@ -228,10 +229,6 @@ }; | ||
function insertCss(css) { | ||
if (!css) { | ||
if (!css || !IS_DOM) { | ||
return; | ||
} | ||
if (typeof DOCUMENT.createElement === 'undefined') { | ||
return; | ||
} | ||
var style = DOCUMENT.createElement('style'); | ||
@@ -933,3 +930,3 @@ style.setAttribute('type', 'text/css'); | ||
if (!DOCUMENT.getElementsByTagName) return; | ||
if (!IS_DOM) return; | ||
@@ -1292,2 +1289,4 @@ mo.observe(DOCUMENT.getElementsByTagName('body')[0], { | ||
function searchPseudoElements(root) { | ||
if (!IS_DOM) return; | ||
var end = perf.begin('searchPseudoElements'); | ||
@@ -1335,2 +1334,4 @@ | ||
if (!IS_DOM) return; | ||
var htmlClassList = DOCUMENT.documentElement.classList; | ||
@@ -1544,3 +1545,3 @@ var hclAdd = function hclAdd(suffix) { | ||
get: function get() { | ||
if (!DOCUMENT.createElement) return; | ||
if (!IS_DOM) return; | ||
@@ -1593,15 +1594,17 @@ var container = DOCUMENT.createElement('div'); | ||
ensureCss(); | ||
if (IS_DOM) { | ||
ensureCss(); | ||
var _params$node = params.node, | ||
node = _params$node === undefined ? DOCUMENT : _params$node, | ||
_params$callback = params.callback, | ||
callback = _params$callback === undefined ? function () {} : _params$callback; | ||
var _params$node = params.node, | ||
node = _params$node === undefined ? DOCUMENT : _params$node, | ||
_params$callback = params.callback, | ||
callback = _params$callback === undefined ? function () {} : _params$callback; | ||
if (config$1.searchPseudoElements) { | ||
searchPseudoElements(node); | ||
if (config$1.searchPseudoElements) { | ||
searchPseudoElements(node); | ||
} | ||
onTree(node, callback); | ||
} | ||
onTree(node, callback); | ||
}, | ||
@@ -1739,3 +1742,3 @@ | ||
var autoReplace = function autoReplace() { | ||
if (config$1.autoReplaceSvg) api.dom.i2svg({ node: DOCUMENT }); | ||
if (IS_DOM && config$1.autoReplaceSvg) api.dom.i2svg({ node: DOCUMENT }); | ||
}; | ||
@@ -1794,6 +1797,5 @@ | ||
if (DOCUMENT) bunker(bootstrap); | ||
if (IS_DOM) bunker(bootstrap); | ||
var config = api.config; | ||
export { config, icon, noAuto, layer, text, library, dom, parse, findIconDefinition }; |
44
index.js
@@ -34,2 +34,3 @@ /*! | ||
var IS_BROWSER = !!WINDOW.document; | ||
var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function'; | ||
var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/'); | ||
@@ -195,3 +196,3 @@ | ||
if (IS_BROWSER) { | ||
if (IS_DOM) { | ||
loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState); | ||
@@ -203,3 +204,3 @@ | ||
var domready = function (fn) { | ||
if (!DOCUMENT) return; | ||
if (!IS_DOM) return; | ||
loaded ? setTimeout(fn, 0) : functions.push(fn); | ||
@@ -234,10 +235,6 @@ }; | ||
function insertCss(css) { | ||
if (!css) { | ||
if (!css || !IS_DOM) { | ||
return; | ||
} | ||
if (typeof DOCUMENT.createElement === 'undefined') { | ||
return; | ||
} | ||
var style = DOCUMENT.createElement('style'); | ||
@@ -939,3 +936,3 @@ style.setAttribute('type', 'text/css'); | ||
if (!DOCUMENT.getElementsByTagName) return; | ||
if (!IS_DOM) return; | ||
@@ -1298,2 +1295,4 @@ mo.observe(DOCUMENT.getElementsByTagName('body')[0], { | ||
function searchPseudoElements(root) { | ||
if (!IS_DOM) return; | ||
var end = perf.begin('searchPseudoElements'); | ||
@@ -1341,2 +1340,4 @@ | ||
if (!IS_DOM) return; | ||
var htmlClassList = DOCUMENT.documentElement.classList; | ||
@@ -1550,3 +1551,3 @@ var hclAdd = function hclAdd(suffix) { | ||
get: function get() { | ||
if (!DOCUMENT.createElement) return; | ||
if (!IS_DOM) return; | ||
@@ -1599,15 +1600,17 @@ var container = DOCUMENT.createElement('div'); | ||
ensureCss(); | ||
if (IS_DOM) { | ||
ensureCss(); | ||
var _params$node = params.node, | ||
node = _params$node === undefined ? DOCUMENT : _params$node, | ||
_params$callback = params.callback, | ||
callback = _params$callback === undefined ? function () {} : _params$callback; | ||
var _params$node = params.node, | ||
node = _params$node === undefined ? DOCUMENT : _params$node, | ||
_params$callback = params.callback, | ||
callback = _params$callback === undefined ? function () {} : _params$callback; | ||
if (config$1.searchPseudoElements) { | ||
searchPseudoElements(node); | ||
if (config$1.searchPseudoElements) { | ||
searchPseudoElements(node); | ||
} | ||
onTree(node, callback); | ||
} | ||
onTree(node, callback); | ||
}, | ||
@@ -1745,3 +1748,3 @@ | ||
var autoReplace = function autoReplace() { | ||
if (config$1.autoReplaceSvg) api.dom.i2svg({ node: DOCUMENT }); | ||
if (IS_DOM && config$1.autoReplaceSvg) api.dom.i2svg({ node: DOCUMENT }); | ||
}; | ||
@@ -1800,4 +1803,3 @@ | ||
if (DOCUMENT) bunker(bootstrap); | ||
if (IS_DOM) bunker(bootstrap); | ||
var config = api.config; | ||
@@ -1804,0 +1806,0 @@ |
@@ -52,3 +52,3 @@ { | ||
}, | ||
"version": "1.2.0-1", | ||
"version": "1.2.0-2", | ||
"name": "@fortawesome/fontawesome", | ||
@@ -55,0 +55,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127994
3364