@projectwallace/css-analyzer 5.4.0 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyzer.cjs +1 -1
- package/dist/analyzer.cjs.map +1 -1
- package/dist/analyzer.modern.js +1 -1
- package/dist/analyzer.modern.js.map +1 -1
- package/dist/analyzer.module.js +1 -1
- package/dist/analyzer.module.js.map +1 -1
- package/dist/analyzer.umd.js +1 -1
- package/dist/analyzer.umd.js.map +1 -1
- package/dist/index.d.ts +70 -12
- package/package.json +4 -4
- package/readme.md +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.module.js","sources":["../src/string-utils.js","../src/selectors/specificity.js","../src/values/colors.js","../src/values/font-families.js","../src/values/font-sizes.js","../src/values/values.js","../src/values/animations.js","../src/vendor-prefix.js","../src/values/vendor-prefix.js","../src/countable-collection.js","../src/context-collection.js","../src/aggregate-collection.js","../src/properties/property-utils.js","../src/occurrence-counter.js","../src/index.js","../src/rules/rules.js"],"sourcesContent":["/**\n * Case-insensitive compare two character codes\n * @param {string} charA\n * @param {string} charB\n * @see https://github.com/csstree/csstree/blob/41f276e8862d8223eeaa01a3d113ab70bb13d2d9/lib/tokenizer/utils.js#L22\n */\nfunction compareChar(referenceCode, testCode) {\n // if uppercase\n if (testCode >= 0x0041 && testCode <= 0x005A) {\n // shifting the 6th bit makes a letter lowercase\n testCode = testCode | 32\n }\n return referenceCode === testCode\n}\n\n/**\n * Case-insensitive string-comparison\n * @param {string} base\n * @param {string} test\n * @returns {boolean} true if the two strings are the same, false otherwise\n */\nexport function strEquals(base, test) {\n if (base.length !== test.length) return false\n\n for (let i = 0; i < base.length; i++) {\n if (compareChar(base.charCodeAt(i), test.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Case-insensitive testing whether a string ends with a given substring\n * @param {string} base e.g. '-webkit-transform'\n * @param {string} cmp e.g. 'transform'\n * @returns {boolean} true if `test` ends with `base`, false otherwise\n */\nexport function endsWith(base, test) {\n const offset = test.length - base.length\n\n if (offset < 0) {\n return false\n }\n\n for (let i = test.length - 1; i >= offset; i--) {\n if (compareChar(base.charCodeAt(i - offset), test.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Case-insensitive testing whether a string starts with a given substring\n * @param {string} base\n * @param {test} test\n * @returns {boolean} true if `test` starts with `base`, false otherwise\n */\nexport function startsWith(base, test) {\n if (test.length < base.length) return false\n\n for (let i = 0; i < base.length; i++) {\n if (compareChar(base.charCodeAt(i), test.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n","import walk from 'css-tree/walker'\nimport { startsWith } from '../string-utils.js'\n\n/**\n * Compare specificity A to Specificity B\n * @param {[number,number,number]} a - Specificity A\n * @param {[number,number,number]} b - Specificity B\n * @returns {number} sortIndex - 0 when a==b, 1 when a<b, -1 when a>b\n */\nfunction compareSpecificity(a, b) {\n if (a[0] === b[0]) {\n if (a[1] === b[1]) {\n return b[2] - a[2]\n }\n\n return b[1] - a[1]\n }\n\n return b[0] - a[0]\n}\n\n/**\n *\n * @param {import('css-tree').SelectorList} selectorListAst\n * @returns {Selector} topSpecificitySelector\n */\nfunction selectorListSpecificities(selectorListAst) {\n const childSelectors = []\n walk(selectorListAst, {\n visit: 'Selector',\n enter(node) {\n childSelectors.push(analyzeSpecificity(node))\n }\n })\n\n return childSelectors.sort((a, b) => compareSpecificity(a.specificity, b.specificity))\n}\n\n/**\n * Get the Specificity for the AST of a Selector Node\n * @param {import('css-tree').Selector} ast - AST Node for a Selector\n * @return {Object}\n * @property {[number,number,number]} specificity\n * @property {number} complexity\n * @property {Boolean} isId\n * @property {Boolean} isA11y\n */\nconst analyzeSpecificity = (node) => {\n let A = 0\n let B = 0\n let C = 0\n let complexity = 0\n let isA11y = false\n\n walk(node, function (selector) {\n switch (selector.type) {\n case 'IdSelector': {\n A++\n complexity++\n break\n }\n case 'ClassSelector': {\n B++\n complexity++\n break\n }\n case 'AttributeSelector': {\n B++\n complexity++\n\n // Add 1 for [attr=value] (or any variation using *= $= ^= |= )\n if (Boolean(selector.value)) {\n complexity++\n }\n\n isA11y = selector.name.name === 'role' || startsWith('aria-', selector.name.name)\n break\n }\n case 'PseudoElementSelector':\n case 'TypeSelector': {\n complexity++\n\n // 42 === '*'.charCodeAt(0)\n if (selector.name.charCodeAt(0) === 42 && selector.name.length === 1) {\n break\n }\n\n C++\n break\n }\n case 'PseudoClassSelector': {\n switch (selector.name) {\n case 'before':\n case 'after':\n case 'first-letter':\n case 'first-line': {\n C++\n complexity++\n return this.skip\n }\n\n // The specificity of an :is(), :not(), or :has() pseudo-class is\n // replaced by the specificity of the most specific complex\n // selector in its selector list argument.\n case 'where':\n case 'is':\n case 'has':\n case 'matches':\n case '-webkit-any':\n case '-moz-any':\n case 'not':\n case 'nth-child':\n case 'nth-last-child': {\n // The specificity of an :nth-child() or :nth-last-child() selector\n // is the specificity of the pseudo class itself (counting as one\n // pseudo-class selector) plus the specificity of the most\n // specific complex selector in its selector list argument (if any).\n if (selector.name === 'nth-child' || selector.name === 'nth-last-child') {\n // +1 for the pseudo class itself\n B++\n }\n\n const selectorList = selectorListSpecificities(selector)\n\n // Bail out for empty/non-existent :nth-child() params\n if (selectorList.length === 0) return\n\n // The specificity of a :where() pseudo-class is replaced by zero,\n // but it does count towards complexity.\n if (selector.name !== 'where') {\n const [topA, topB, topC] = selectorList[0].specificity\n A += topA\n B += topB\n C += topC\n }\n\n for (let i = 0; i < selectorList.length; i++) {\n const listItem = selectorList[i]\n if (listItem.isA11y) {\n isA11y = true\n }\n complexity += listItem.complexity\n }\n\n complexity++\n return this.skip\n }\n\n default: {\n // Regular pseudo classes have specificity [0,1,0]\n complexity++\n B++\n return this.skip\n }\n }\n }\n case 'Combinator': {\n complexity++\n break\n }\n }\n })\n\n return {\n /** @type {[number,number,number]} */\n specificity: [A, B, C],\n complexity,\n isId: A > 0,\n isA11y\n }\n}\n\nexport {\n analyzeSpecificity,\n compareSpecificity,\n}","export const colorNames = {\n // CSS Named Colors\n // Spec: https://drafts.csswg.org/css-color/#named-colors\n aliceblue: 1,\n antiquewhite: 1,\n aqua: 1,\n aquamarine: 1,\n azure: 1,\n beige: 1,\n bisque: 1,\n black: 1,\n blanchedalmond: 1,\n blue: 1,\n blueviolet: 1,\n brown: 1,\n burlywood: 1,\n cadetblue: 1,\n chartreuse: 1,\n chocolate: 1,\n coral: 1,\n cornflowerblue: 1,\n cornsilk: 1,\n crimson: 1,\n cyan: 1,\n darkblue: 1,\n darkcyan: 1,\n darkgoldenrod: 1,\n darkgray: 1,\n darkgreen: 1,\n darkgrey: 1,\n darkkhaki: 1,\n darkmagenta: 1,\n darkolivegreen: 1,\n darkorange: 1,\n darkorchid: 1,\n darkred: 1,\n darksalmon: 1,\n darkseagreen: 1,\n darkslateblue: 1,\n darkslategray: 1,\n darkslategrey: 1,\n darkturquoise: 1,\n darkviolet: 1,\n deeppink: 1,\n deepskyblue: 1,\n dimgray: 1,\n dimgrey: 1,\n dodgerblue: 1,\n firebrick: 1,\n floralwhite: 1,\n forestgreen: 1,\n fuchsia: 1,\n gainsboro: 1,\n ghostwhite: 1,\n gold: 1,\n goldenrod: 1,\n gray: 1,\n green: 1,\n greenyellow: 1,\n grey: 1,\n honeydew: 1,\n hotpink: 1,\n indianred: 1,\n indigo: 1,\n ivory: 1,\n khaki: 1,\n lavender: 1,\n lavenderblush: 1,\n lawngreen: 1,\n lemonchiffon: 1,\n lightblue: 1,\n lightcoral: 1,\n lightcyan: 1,\n lightgoldenrodyellow: 1,\n lightgray: 1,\n lightgreen: 1,\n lightgrey: 1,\n lightpink: 1,\n lightsalmon: 1,\n lightseagreen: 1,\n lightskyblue: 1,\n lightslategray: 1,\n lightslategrey: 1,\n lightsteelblue: 1,\n lightyellow: 1,\n lime: 1,\n limegreen: 1,\n linen: 1,\n magenta: 1,\n maroon: 1,\n mediumaquamarine: 1,\n mediumblue: 1,\n mediumorchid: 1,\n mediumpurple: 1,\n mediumseagreen: 1,\n mediumslateblue: 1,\n mediumspringgreen: 1,\n mediumturquoise: 1,\n mediumvioletred: 1,\n midnightblue: 1,\n mintcream: 1,\n mistyrose: 1,\n moccasin: 1,\n navajowhite: 1,\n navy: 1,\n oldlace: 1,\n olive: 1,\n olivedrab: 1,\n orange: 1,\n orangered: 1,\n orchid: 1,\n palegoldenrod: 1,\n palegreen: 1,\n paleturquoise: 1,\n palevioletred: 1,\n papayawhip: 1,\n peachpuff: 1,\n peru: 1,\n pink: 1,\n plum: 1,\n powderblue: 1,\n purple: 1,\n rebeccapurple: 1,\n red: 1,\n rosybrown: 1,\n royalblue: 1,\n saddlebrown: 1,\n salmon: 1,\n sandybrown: 1,\n seagreen: 1,\n seashell: 1,\n sienna: 1,\n silver: 1,\n skyblue: 1,\n slateblue: 1,\n slategray: 1,\n slategrey: 1,\n snow: 1,\n springgreen: 1,\n steelblue: 1,\n tan: 1,\n teal: 1,\n thistle: 1,\n tomato: 1,\n turquoise: 1,\n violet: 1,\n wheat: 1,\n white: 1,\n whitesmoke: 1,\n yellow: 1,\n yellowgreen: 1,\n\n // CSS System Colors\n // Spec: https://drafts.csswg.org/css-color/#css-system-colors\n canvas: 1,\n canvastext: 1,\n linktext: 1,\n visitedtext: 1,\n activetext: 1,\n buttonface: 1,\n buttontext: 1,\n buttonborder: 1,\n field: 1,\n fieldtext: 1,\n highlight: 1,\n highlighttext: 1,\n selecteditem: 1,\n selecteditemtext: 1,\n mark: 1,\n marktext: 1,\n graytext: 1,\n\n // TODO: Deprecated CSS System colors\n // Spec: https://drafts.csswg.org/css-color/#deprecated-system-colors\n}\n\nexport const colorFunctions = {\n rgb: 1,\n rgba: 1,\n hsl: 1,\n hsla: 1,\n hwb: 1,\n lab: 1,\n lch: 1,\n oklab: 1,\n oklch: 1,\n color: 1,\n}\n","import walk from 'css-tree/walker'\n\nconst systemKeywords = {\n // Global CSS keywords\n 'inherit': 1,\n 'initial': 1,\n 'unset': 1,\n 'revert': 1,\n\n // System font keywords\n 'caption': 1,\n 'icon': 1,\n 'menu': 1,\n 'message-box': 1,\n 'small-caption': 1,\n 'status-bar': 1,\n}\n\nconst keywordDisallowList = {\n // font-weight, font-stretch, font-style\n 'normal': 1,\n\n // font-size keywords\n 'xx-small': 1,\n 'x-small': 1,\n 'small': 1,\n 'medium': 1,\n 'large': 1,\n 'x-large': 1,\n 'xx-large': 1,\n 'larger': 1,\n 'smaller': 1,\n\n // font-weight keywords\n 'bold': 1,\n 'bolder': 1,\n 'lighter': 1,\n\n // font-stretch keywords\n 'ultra-condensed': 1,\n 'extra-condensed': 1,\n 'condensed': 1,\n 'semi-condensed': 1,\n 'semi-expanded': 1,\n 'expanded': 1,\n 'extra-expanded': 1,\n 'ultra-expanded': 1,\n\n // font-style keywords\n 'italic': 1,\n 'oblique': 1,\n}\n\nconst COMMA = 44 // ','.charCodeAt(0) === 44\n\nexport function isFontFamilyKeyword(node) {\n const firstChild = node.children.first\n return firstChild.type === 'Identifier' && systemKeywords[firstChild.name]\n}\n\nexport function getFamilyFromFont(node, stringifyNode) {\n let parts = ''\n\n walk(node, {\n reverse: true,\n enter: function (fontNode) {\n if (fontNode.type === 'String') {\n const loc = fontNode.loc.start\n // Stringify the first character to get the correct quote character\n const quote = stringifyNode({\n loc: {\n start: {\n line: loc.line,\n column: loc.column\n },\n end: {\n line: loc.line,\n column: loc.column + 1\n }\n }\n })\n return parts = quote + fontNode.value + quote + parts\n }\n if (fontNode.type === 'Operator' && fontNode.value.charCodeAt(0) === COMMA) {\n return parts = fontNode.value + parts\n }\n if (fontNode.type === 'Identifier') {\n if (keywordDisallowList[fontNode.name]) {\n return this.skip\n }\n return parts = fontNode.name + parts\n }\n }\n })\n\n return parts\n}\n","import walk from 'css-tree/walker'\n\nconst sizeKeywords = {\n 'xx-small': 1,\n 'x-small': 1,\n 'small': 1,\n 'medium': 1,\n 'large': 1,\n 'x-large': 1,\n 'xx-large': 1,\n 'larger': 1,\n 'smaller': 1,\n}\n\nconst keywords = {\n // Global CSS keywords\n 'inherit': 1,\n 'initial': 1,\n 'unset': 1,\n 'revert': 1,\n\n // System font keywords\n 'caption': 1,\n 'icon': 1,\n 'menu': 1,\n 'message-box': 1,\n 'small-caption': 1,\n 'status-bar': 1,\n}\n\nconst ZERO = 48 // '0'.charCodeAt(0) === 48\nconst SLASH = 47 // '/'.charCodeAt(0) === 47\n\nexport function isFontSizeKeyword(node) {\n const firstChild = node.children.first\n return firstChild.type === 'Identifier' && keywords[firstChild.name]\n}\n\nexport function getSizeFromFont(node) {\n let operator = false\n let size\n\n walk(node, function (fontNode) {\n switch (fontNode.type) {\n case 'Number': {\n // Special case for `font: 0/0 a`\n if (fontNode.value.charCodeAt(0) === ZERO) {\n size = '0'\n return this.break\n }\n }\n case 'Operator': {\n if (fontNode.value.charCodeAt(0) === SLASH) {\n operator = true\n }\n break\n }\n case 'Dimension': {\n if (!operator) {\n size = fontNode.value + fontNode.unit\n return this.break\n }\n }\n case 'Identifier': {\n if (sizeKeywords[fontNode.name]) {\n size = fontNode.name\n return this.break\n }\n }\n }\n })\n\n return size\n}\n","const keywords = {\n 'auto': 1,\n 'inherit': 1,\n 'initial': 1,\n 'unset': 1,\n 'revert': 1,\n 'none': 1, // for `text-shadow`, `box-shadow` and `background`\n}\n\nexport function isValueKeyword(node) {\n if (!node.children) return false\n const firstChild = node.children.first\n\n if (!firstChild) return false\n if (node.children.size > 1) return false\n return firstChild.type === 'Identifier' && keywords[firstChild.name]\n}\n","const timingKeywords = {\n 'linear': 1,\n 'ease': 1,\n 'ease-in': 1,\n 'ease-out': 1,\n 'ease-in-out': 1,\n 'step-start': 1,\n 'step-end': 1,\n}\n\nexport function analyzeAnimation(children, stringifyNode) {\n let durationFound = false\n const durations = []\n const timingFunctions = []\n\n children.forEach(child => {\n // Right after a ',' we start over again\n if (child.type === 'Operator') {\n return durationFound = false\n }\n if (child.type === 'Dimension' && durationFound === false) {\n durationFound = true\n return durations.push(stringifyNode(child))\n }\n if (child.type === 'Identifier' && timingKeywords[child.name]) {\n return timingFunctions.push(stringifyNode(child))\n }\n if (child.type === 'Function'\n && (\n child.name === 'cubic-bezier' || child.name === 'steps'\n )\n ) {\n return timingFunctions.push(stringifyNode(child))\n }\n })\n\n return [durations, timingFunctions]\n}\n","const HYPHENMINUS = 45; // '-'.charCodeAt()\n\n/**\n * @param {string} keyword\n * @returns {boolean}\n */\nfunction hasVendorPrefix(keyword) {\n if (keyword.charCodeAt(0) === HYPHENMINUS && keyword.charCodeAt(1) !== HYPHENMINUS) {\n // String must have a 2nd occurrence of '-', at least at position 3 (offset=2)\n if (keyword.indexOf('-', 2) !== -1) {\n return true\n }\n }\n\n return false\n}\n\nexport {\n hasVendorPrefix\n}","import { hasVendorPrefix } from '../vendor-prefix.js'\n\nexport function isAstVendorPrefixed(node) {\n if (!node.children) {\n return false\n }\n\n const children = node.children.toArray()\n\n for (let index = 0; index < children.length; index++) {\n const node = children[index]\n const { type, name } = node;\n\n if (type === 'Identifier' && hasVendorPrefix(name)) {\n return true\n }\n\n if (type === 'Function') {\n if (hasVendorPrefix(name)) {\n return true\n }\n\n if (isAstVendorPrefixed(node)) {\n return true\n }\n }\n }\n\n return false\n}\n","class CountableCollection {\n /**\n * @param {string[]} initial\n */\n constructor(initial) {\n /** @type [index: string]: string */\n this._items = {}\n /** @type number */\n this._total = 0\n /** @type number */\n this._totalUnique = 0\n\n if (initial) {\n for (let i = 0; i < initial.length; i++) {\n this.push(initial[i])\n }\n }\n }\n\n /**\n * Push an item to the end of this collection\n * @param {string} item\n * @returns {void}\n */\n push(item) {\n this._total++\n\n if (this._items[item]) {\n this._items[item]++\n return\n }\n\n this._items[item] = 1\n this._totalUnique++\n }\n\n /**\n * Get the size of this collection\n * @returns {number} the size of this collection\n */\n size() {\n return this._total\n }\n\n /**\n * Get the counts of this collection, like total, uniques, etc.\n */\n count() {\n return {\n total: this._total,\n totalUnique: this._totalUnique,\n unique: this._items,\n uniquenessRatio: this._total === 0 ? 0 : this._totalUnique / this._total,\n }\n }\n}\n\nexport {\n CountableCollection\n}","import { CountableCollection } from './countable-collection.js'\n\nclass ContextCollection {\n constructor() {\n this._list = new CountableCollection()\n /** @type {[index; string]: CountableCollection} */\n this._contexts = {}\n }\n\n /**\n * Add an item to this _list's context\n * @param {string} item Item to push\n * @param {string} context Context to push Item to\n */\n push(item, context) {\n this._list.push(item)\n\n if (!this._contexts[context]) {\n this._contexts[context] = new CountableCollection()\n }\n\n this._contexts[context].push(item)\n }\n\n count() {\n /** @type {[index: string]: string} */\n const itemsPerContext = {}\n\n for (let context in this._contexts) {\n itemsPerContext[context] = this._contexts[context].count()\n }\n\n return Object.assign(this._list.count(), {\n itemsPerContext\n })\n }\n}\n\nexport {\n ContextCollection\n}","/**\n * Find the mode (most occurring value) in an array of Numbers\n * Takes the mean/average of multiple values if multiple values occur the same amount of times.\n *\n * @see https://github.com/angus-c/just/blob/684af9ca0c7808bc78543ec89379b1fdfce502b1/packages/array-mode/index.js\n * @param {Array} arr - Array to find the mode value for\n * @returns {Number} mode - The `mode` value of `arr`\n */\nfunction Mode(arr) {\n const frequencies = Object.create(null)\n let maxOccurrences = -1\n let maxOccurenceCount = 0\n let sum = 0\n\n for (let i = 0; i < arr.length; i++) {\n const element = arr[i]\n const updatedCount = (frequencies[element] || 0) + 1\n frequencies[element] = updatedCount\n\n if (updatedCount > maxOccurrences) {\n maxOccurrences = updatedCount\n maxOccurenceCount = 0\n sum = 0\n }\n\n if (updatedCount >= maxOccurrences) {\n maxOccurenceCount++\n sum += element\n }\n }\n\n return sum / maxOccurenceCount\n}\n\n/**\n * Find the middle number in an Array of Numbers\n * Returns the average of 2 numbers if the Array length is an even number\n * @see https://github.com/angus-c/just/blob/684af9ca0c7808bc78543ec89379b1fdfce502b1/packages/array-median/index.js\n * @param {Array} arr - A sorted Array\n * @returns {Number} - The array's Median\n */\nfunction Median(arr) {\n const middle = arr.length / 2\n const lowerMiddleRank = Math.floor(middle)\n\n if (middle !== lowerMiddleRank) {\n return arr[lowerMiddleRank]\n }\n return (arr[lowerMiddleRank] + arr[lowerMiddleRank - 1]) / 2\n}\n\nclass AggregateCollection {\n constructor() {\n /** @type number[] */\n this._items = []\n }\n\n /**\n * Add a new Integer at the end of this AggregateCollection\n * @param {number} item - The item to add\n */\n add(item) {\n this._items.push(item)\n }\n\n size() {\n return this._items.length\n }\n\n aggregate() {\n if (this._items.length === 0) {\n return {\n min: 0,\n max: 0,\n mean: 0,\n mode: 0,\n median: 0,\n range: 0,\n sum: 0,\n }\n }\n\n // TODO: can we avoid this sort()? It's slow\n /** @type Number[] */\n const sorted = this._items.slice().sort((a, b) => a - b)\n const min = sorted[0]\n const max = sorted[sorted.length - 1]\n\n const sum = this._items.reduce((total, num) => (total += num))\n const mode = Mode(this._items)\n const median = Median(sorted)\n\n return {\n min,\n max,\n mean: sum / this._items.length,\n mode,\n median,\n range: max - min,\n sum,\n }\n }\n\n /**\n * @returns {number[]} All _items in this collection\n */\n toArray() {\n return this._items\n }\n}\n\nexport {\n AggregateCollection\n}","import { hasVendorPrefix } from '../vendor-prefix.js'\nimport { endsWith } from '../string-utils.js'\n\n/**\n * @param {string} property\n * @see https://github.com/csstree/csstree/blob/master/lib/utils/names.js#L69\n */\nexport function isHack(property) {\n if (isCustom(property) || hasVendorPrefix(property)) return false\n\n let code = property.charCodeAt(0)\n\n return code === 47 // /\n || code === 95 // _\n || code === 43 // +\n || code === 42 // *\n || code === 38 // &\n || code === 36 // $\n || code === 35 // #\n}\n\nexport function isCustom(property) {\n if (property.length < 3) return false\n // 45 === '-'.charCodeAt(0)\n return property.charCodeAt(0) === 45 && property.charCodeAt(1) === 45\n}\n\nexport function isProperty(basename, property) {\n if (isCustom(property)) return false\n return endsWith(basename, property)\n}","export class OccurrenceCounter {\n constructor() {\n this._items = Object.create(null)\n }\n\n push(item) {\n if (this._items[item]) {\n return this._items[item]++\n }\n\n return this._items[item] = 1\n }\n\n count() {\n return Object.keys(this._items).length\n }\n}\n","import parse from 'css-tree/parser'\nimport walk from 'css-tree/walker'\nimport { analyzeRule } from './rules/rules.js'\nimport { analyzeSpecificity, compareSpecificity } from './selectors/specificity.js'\nimport { colorFunctions, colorNames } from './values/colors.js'\nimport { isFontFamilyKeyword, getFamilyFromFont } from './values/font-families.js'\nimport { isFontSizeKeyword, getSizeFromFont } from './values/font-sizes.js'\nimport { isValueKeyword } from './values/values.js'\nimport { analyzeAnimation } from './values/animations.js'\nimport { isAstVendorPrefixed } from './values/vendor-prefix.js'\nimport { ContextCollection } from './context-collection.js'\nimport { CountableCollection } from './countable-collection.js'\nimport { AggregateCollection } from './aggregate-collection.js'\nimport { strEquals, startsWith, endsWith } from './string-utils.js'\nimport { hasVendorPrefix } from './vendor-prefix.js'\nimport { isCustom, isHack, isProperty } from './properties/property-utils.js'\nimport { OccurrenceCounter } from './occurrence-counter.js'\n\n/**\n * Analyze CSS\n * @param {string} css\n */\nconst analyze = (css) => {\n const start = new Date()\n\n // We need all lines later on when we need to stringify the AST again\n // e.g. for Selectors\n const lines = css.split(/\\r?\\n/)\n\n /**\n * Recreate the authored CSS from a CSSTree node\n * @param {import('css-tree').CssNode} node - Node from CSSTree AST to stringify\n * @returns {string} str - The stringified node\n */\n function stringifyNode(node) {\n const start = node.loc.start\n const end = node.loc.end\n const lineCount = end.line - start.line\n\n // Single-line nodes\n if (lineCount === 0) {\n return lines[start.line - 1].substring(start.column - 1, end.column - 1)\n }\n\n // Multi-line nodes\n let value = ''\n\n for (let i = start.line; i <= end.line; i++) {\n const line = lines[i - 1]\n // First line\n if (i === start.line) {\n value += line.substring(start.column - 1) + '\\n'\n continue\n }\n // Last line\n if (i === end.line) {\n value += line.substring(0, end.column - 1)\n continue\n }\n // All lines in between first and last\n value += line + '\\n'\n }\n\n return value\n }\n\n // Stylesheet\n let totalComments = 0\n let commentsSize = 0\n const embeds = new CountableCollection()\n\n const startParse = new Date()\n\n const ast = parse(css, {\n parseAtrulePrelude: false,\n parseCustomProperty: true, // To find font-families, colors, etc.\n positions: true, // So we can use stringifyNode()\n onComment: function (comment) {\n totalComments++\n commentsSize += comment.length\n },\n })\n\n const startAnalysis = new Date()\n\n // Atrules\n let totalAtRules = 0\n /** @type {{[index: string]: string}[]} */\n const fontfaces = []\n const layers = new CountableCollection()\n const imports = new CountableCollection()\n const medias = new CountableCollection()\n const charsets = new CountableCollection()\n const supports = new CountableCollection()\n const keyframes = new CountableCollection()\n const prefixedKeyframes = new CountableCollection()\n const containers = new CountableCollection()\n\n // Rules\n let totalRules = 0\n let emptyRules = 0\n const selectorsPerRule = new AggregateCollection()\n const declarationsPerRule = new AggregateCollection()\n\n // SELECTORS\n const keyframeSelectors = new CountableCollection()\n /** @type number */\n const uniqueSelectors = new OccurrenceCounter()\n /** @type [number,number,number] */\n let maxSpecificity\n /** @type [number,number,number] */\n let minSpecificity\n let specificityA = new AggregateCollection()\n let specificityB = new AggregateCollection()\n let specificityC = new AggregateCollection()\n const selectorComplexities = new AggregateCollection()\n /** @type [number,number,number][] */\n const specificities = []\n const ids = new CountableCollection()\n const a11y = new CountableCollection()\n\n // Declarations\n const uniqueDeclarations = new OccurrenceCounter()\n let totalDeclarations = 0\n let importantDeclarations = 0\n let importantsInKeyframes = 0\n\n // Properties\n const properties = new CountableCollection()\n const propertyHacks = new CountableCollection()\n const propertyVendorPrefixes = new CountableCollection()\n const customProperties = new CountableCollection()\n\n // Values\n const vendorPrefixedValues = new CountableCollection()\n const zindex = new CountableCollection()\n const textShadows = new CountableCollection()\n const boxShadows = new CountableCollection()\n const fontFamilies = new CountableCollection()\n const fontSizes = new CountableCollection()\n const timingFunctions = new CountableCollection()\n const durations = new CountableCollection()\n const colors = new ContextCollection()\n const units = new ContextCollection()\n\n walk(ast, function (node) {\n switch (node.type) {\n case 'Atrule': {\n totalAtRules++\n const atRuleName = node.name\n\n if (atRuleName === 'font-face') {\n /** @type {[index: string]: string} */\n const descriptors = {}\n\n node.block.children.forEach(\n /** @param {import('css-tree').Declaration} descriptor */\n descriptor => (descriptors[descriptor.property] = stringifyNode(descriptor.value))\n )\n\n fontfaces.push(descriptors)\n break\n }\n if (atRuleName === 'media') {\n medias.push(node.prelude.value)\n break\n }\n if (atRuleName === 'supports') {\n supports.push(node.prelude.value)\n break\n }\n if (endsWith('keyframes', atRuleName)) {\n const name = '@' + atRuleName + ' ' + node.prelude.value\n if (hasVendorPrefix(atRuleName)) {\n prefixedKeyframes.push(name)\n }\n keyframes.push(name)\n break\n }\n if (atRuleName === 'import') {\n imports.push(node.prelude.value)\n break\n }\n if (atRuleName === 'charset') {\n charsets.push(node.prelude.value)\n break\n }\n if (atRuleName === 'container') {\n containers.push(node.prelude.value)\n break\n }\n if (atRuleName === 'layer') {\n containers.push(\n node.prelude.value.trim()\n .split(',')\n .map(name => name.trim())\n .forEach(name => layers.push(name))\n )\n }\n break\n }\n case 'Rule': {\n const [numSelectors, numDeclarations] = analyzeRule(node)\n\n totalRules++\n\n if (numDeclarations === 0) {\n emptyRules++\n }\n\n selectorsPerRule.add(numSelectors)\n declarationsPerRule.add(numDeclarations)\n break\n }\n case 'Selector': {\n const selector = stringifyNode(node)\n\n if (this.atrule && endsWith('keyframes', this.atrule.name)) {\n keyframeSelectors.push(selector)\n return this.skip\n }\n\n const { specificity, complexity, isId, isA11y } = analyzeSpecificity(node)\n\n if (isId) {\n ids.push(selector)\n }\n\n if (isA11y) {\n a11y.push(selector)\n }\n\n uniqueSelectors.push(selector)\n selectorComplexities.add(complexity)\n\n if (maxSpecificity === undefined) {\n maxSpecificity = specificity\n }\n\n if (minSpecificity === undefined) {\n minSpecificity = specificity\n }\n\n specificityA.add(specificity[0])\n specificityB.add(specificity[1])\n specificityC.add(specificity[2])\n\n if (minSpecificity !== undefined && compareSpecificity(minSpecificity, specificity) < 0) {\n minSpecificity = specificity\n }\n\n if (maxSpecificity !== undefined && compareSpecificity(maxSpecificity, specificity) > 0) {\n maxSpecificity = specificity\n }\n\n specificities.push(specificity)\n\n // Avoid deeper walking of selectors to not mess with\n // our specificity calculations in case of a selector\n // with :where() or :is() that contain SelectorLists\n // as children\n return this.skip\n }\n case 'Dimension': {\n if (!this.declaration) {\n break\n }\n\n units.push(node.unit, this.declaration.property)\n\n return this.skip\n }\n case 'Url': {\n if (startsWith('data:', node.value)) {\n embeds.push(node.value)\n }\n break\n }\n case 'Value': {\n if (isValueKeyword(node)) {\n break\n }\n\n const property = this.declaration.property\n\n if (isAstVendorPrefixed(node)) {\n vendorPrefixedValues.push(stringifyNode(node))\n }\n\n // Process properties first that don't have colors,\n // so we can avoid further walking them;\n if (isProperty('z-index', property)) {\n if (!isValueKeyword(node)) {\n zindex.push(stringifyNode(node))\n }\n return this.skip\n } else if (isProperty('font', property)) {\n if (!isFontFamilyKeyword(node)) {\n fontFamilies.push(getFamilyFromFont(node, stringifyNode))\n }\n if (!isFontSizeKeyword(node)) {\n const size = getSizeFromFont(node)\n if (size) {\n fontSizes.push(size)\n }\n }\n break\n } else if (isProperty('font-size', property)) {\n if (!isFontSizeKeyword(node)) {\n fontSizes.push(stringifyNode(node))\n }\n break\n } else if (isProperty('font-family', property)) {\n if (!isFontFamilyKeyword(node)) {\n fontFamilies.push(stringifyNode(node))\n }\n break\n } else if (isProperty('transition', property) || isProperty('animation', property)) {\n const [times, fns] = analyzeAnimation(node.children, stringifyNode)\n for (let i = 0; i < times.length; i++) {\n durations.push(times[i])\n }\n for (let i = 0; i < fns.length; i++) {\n timingFunctions.push(fns[i])\n }\n break\n } else if (isProperty('animation-duration', property) || isProperty('transition-duration', property)) {\n durations.push(stringifyNode(node))\n break\n } else if (isProperty('transition-timing-function', property) || isProperty('animation-timing-function', property)) {\n timingFunctions.push(stringifyNode(node))\n break\n } else if (isProperty('text-shadow', property)) {\n if (!isValueKeyword(node)) {\n textShadows.push(stringifyNode(node))\n }\n // no break here: potentially contains colors\n } else if (isProperty('box-shadow', property)) {\n if (!isValueKeyword(node)) {\n boxShadows.push(stringifyNode(node))\n }\n // no break here: potentially contains colors\n }\n\n walk(node, function (valueNode) {\n switch (valueNode.type) {\n case 'Hash': {\n colors.push('#' + valueNode.value, property)\n\n return this.skip\n }\n case 'Identifier': {\n const { name } = valueNode\n // Bail out if it can't be a color name\n // 20 === 'lightgoldenrodyellow'.length\n // 3 === 'red'.length\n if (name.length > 20 || name.length < 3) {\n return this.skip\n }\n if (colorNames[name.toLowerCase()]) {\n colors.push(stringifyNode(valueNode), property)\n }\n return this.skip\n }\n case 'Function': {\n // Don't walk var() multiple times\n if (strEquals('var', valueNode.name)) {\n return this.skip\n }\n if (colorFunctions[valueNode.name.toLowerCase()]) {\n colors.push(stringifyNode(valueNode), property)\n }\n // No this.skip here intentionally,\n // otherwise we'll miss colors in linear-gradient() etc.\n }\n }\n })\n break\n }\n case 'Declaration': {\n totalDeclarations++\n\n const declaration = stringifyNode(node)\n uniqueDeclarations.push(declaration)\n\n if (node.important) {\n importantDeclarations++\n\n if (this.atrule && endsWith('keyframes', this.atrule.name)) {\n importantsInKeyframes++\n }\n }\n\n const { property } = node\n\n properties.push(property)\n\n if (hasVendorPrefix(property)) {\n propertyVendorPrefixes.push(property)\n } else if (isHack(property)) {\n propertyHacks.push(property)\n } else if (isCustom(property)) {\n customProperties.push(property)\n }\n break\n }\n }\n })\n\n const embeddedContent = embeds.count()\n const embedSize = Object.keys(embeddedContent.unique).join('').length\n\n const totalUniqueDeclarations = uniqueDeclarations.count()\n\n const totalSelectors = selectorComplexities.size()\n const specificitiesA = specificityA.aggregate()\n const specificitiesB = specificityB.aggregate()\n const specificitiesC = specificityC.aggregate()\n const complexityCount = new CountableCollection(selectorComplexities.toArray()).count()\n const totalUniqueSelectors = uniqueSelectors.count()\n const assign = Object.assign\n\n return {\n stylesheet: {\n sourceLinesOfCode: totalAtRules + totalSelectors + totalDeclarations + keyframeSelectors.size(),\n linesOfCode: lines.length,\n size: css.length,\n comments: {\n total: totalComments,\n size: commentsSize,\n },\n embeddedContent: assign(embeddedContent, {\n size: {\n total: embedSize,\n ratio: css.length === 0 ? 0 : embedSize / css.length,\n },\n }),\n },\n atrules: {\n fontface: {\n total: fontfaces.length,\n totalUnique: fontfaces.length,\n unique: fontfaces,\n uniquenessRatio: fontfaces.length === 0 ? 0 : 1\n },\n import: imports.count(),\n media: medias.count(),\n charset: charsets.count(),\n supports: supports.count(),\n keyframes: assign(\n keyframes.count(), {\n prefixed: assign(\n prefixedKeyframes.count(), {\n ratio: keyframes.size() === 0 ? 0 : prefixedKeyframes.size() / keyframes.size()\n }),\n }),\n container: containers.count(),\n layer: layers.count(),\n },\n rules: {\n total: totalRules,\n empty: {\n total: emptyRules,\n ratio: totalRules === 0 ? 0 : emptyRules / totalRules\n },\n selectors: assign(\n selectorsPerRule.aggregate(), {\n items: selectorsPerRule.toArray(),\n }),\n declarations: assign(\n declarationsPerRule.aggregate(), {\n items: declarationsPerRule.toArray()\n }),\n },\n selectors: {\n total: totalSelectors,\n totalUnique: totalUniqueSelectors,\n uniquenessRatio: totalSelectors === 0 ? 0 : totalUniqueSelectors / totalSelectors,\n specificity: {\n min: minSpecificity === undefined ? [0, 0, 0] : minSpecificity,\n max: maxSpecificity === undefined ? [0, 0, 0] : maxSpecificity,\n sum: [specificitiesA.sum, specificitiesB.sum, specificitiesC.sum],\n mean: [specificitiesA.mean, specificitiesB.mean, specificitiesC.mean],\n mode: [specificitiesA.mode, specificitiesB.mode, specificitiesC.mode],\n median: [specificitiesA.median, specificitiesB.median, specificitiesC.median],\n items: specificities\n },\n complexity: assign(\n selectorComplexities.aggregate(),\n complexityCount, {\n items: selectorComplexities.toArray(),\n }),\n id: assign(\n ids.count(), {\n ratio: totalSelectors === 0 ? 0 : ids.size() / totalSelectors,\n }),\n accessibility: assign(\n a11y.count(), {\n ratio: totalSelectors === 0 ? 0 : a11y.size() / totalSelectors,\n }),\n keyframes: keyframeSelectors.count(),\n },\n declarations: {\n total: totalDeclarations,\n unique: {\n total: totalUniqueDeclarations,\n ratio: totalDeclarations === 0 ? 0 : totalUniqueDeclarations / totalDeclarations,\n },\n importants: {\n total: importantDeclarations,\n ratio: totalDeclarations === 0 ? 0 : importantDeclarations / totalDeclarations,\n inKeyframes: {\n total: importantsInKeyframes,\n ratio: importantDeclarations === 0 ? 0 : importantsInKeyframes / importantDeclarations,\n },\n },\n },\n properties: assign(\n properties.count(), {\n prefixed: assign(\n propertyVendorPrefixes.count(), {\n ratio: properties.size() === 0 ? 0 : propertyVendorPrefixes.size() / properties.size(),\n }),\n custom: assign(\n customProperties.count(), {\n ratio: properties.size() === 0 ? 0 : customProperties.size() / properties.size(),\n }),\n browserhacks: assign(\n propertyHacks.count(), {\n ratio: properties.size() === 0 ? 0 : propertyHacks.size() / properties.size(),\n }),\n }),\n values: {\n colors: colors.count(),\n fontFamilies: fontFamilies.count(),\n fontSizes: fontSizes.count(),\n zindexes: zindex.count(),\n textShadows: textShadows.count(),\n boxShadows: boxShadows.count(),\n animations: {\n durations: durations.count(),\n timingFunctions: timingFunctions.count(),\n },\n prefixes: vendorPrefixedValues.count(),\n units: units.count(),\n },\n __meta__: {\n parseTime: startAnalysis - startParse,\n analyzeTime: new Date() - startAnalysis,\n total: new Date() - start\n }\n }\n}\n\nexport {\n analyze,\n compareSpecificity,\n}\n","import walk from 'css-tree/walker'\n\nconst analyzeRule = function (ruleNode) {\n let numSelectors = 0\n let numDeclarations = 0\n\n walk(ruleNode, function (childNode) {\n if (childNode.type === 'Selector') {\n numSelectors++\n return this.skip\n }\n\n if (childNode.type === 'Declaration') {\n numDeclarations++\n return this.skip\n }\n })\n\n return [numSelectors, numDeclarations]\n}\n\nexport {\n analyzeRule,\n}"],"names":["compareChar","referenceCode","testCode","endsWith","base","test","offset","length","i","charCodeAt","startsWith","compareSpecificity","a","b","analyzeSpecificity","node","A","B","C","complexity","isA11y","walk","selector","type","Boolean","value","name","skip","selectorList","childSelectors","visit","enter","push","sort","specificity","listItem","isId","colorNames","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","canvas","canvastext","linktext","visitedtext","activetext","buttonface","buttontext","buttonborder","field","fieldtext","highlight","highlighttext","selecteditem","selecteditemtext","mark","marktext","graytext","colorFunctions","rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","systemKeywords","inherit","initial","unset","revert","caption","icon","menu","keywordDisallowList","normal","small","medium","large","larger","smaller","bold","bolder","lighter","condensed","expanded","italic","oblique","isFontFamilyKeyword","firstChild","children","first","sizeKeywords","keywords","isFontSizeKeyword","auto","none","isValueKeyword","size","timingKeywords","linear","ease","hasVendorPrefix","keyword","indexOf","isAstVendorPrefixed","toArray","index","CountableCollection","this","_items","_total","_totalUnique","item","count","total","totalUnique","unique","uniquenessRatio","ContextCollection","_list","_contexts","context","itemsPerContext","Object","assign","AggregateCollection","add","aggregate","min","max","mean","mode","median","range","sum","arr","middle","lowerMiddleRank","sorted","slice","reduce","num","frequencies","create","maxOccurrences","maxOccurenceCount","element","updatedCount","Mode","Math","floor","isCustom","property","isProperty","basename","OccurrenceCounter","keys","analyze","css","start","Date","lines","split","stringifyNode","loc","end","line","substring","column","maxSpecificity","minSpecificity","totalComments","commentsSize","embeds","startParse","ast","parse","parseAtrulePrelude","parseCustomProperty","positions","onComment","comment","startAnalysis","totalAtRules","fontfaces","layers","imports","medias","charsets","supports","keyframes","prefixedKeyframes","containers","totalRules","emptyRules","selectorsPerRule","declarationsPerRule","keyframeSelectors","uniqueSelectors","specificityA","specificityB","specificityC","selectorComplexities","specificities","ids","a11y","uniqueDeclarations","totalDeclarations","importantDeclarations","importantsInKeyframes","properties","propertyHacks","propertyVendorPrefixes","customProperties","vendorPrefixedValues","zindex","textShadows","boxShadows","fontFamilies","fontSizes","timingFunctions","durations","colors","units","atRuleName","descriptors","block","forEach","descriptor","prelude","trim","map","ruleNode","numSelectors","numDeclarations","childNode","analyzeRule","atrule","undefined","declaration","unit","parts","reverse","fontNode","quote","getFamilyFromFont","operator","getSizeFromFont","durationFound","child","analyzeAnimation","times","fns","valueNode","toLowerCase","strEquals","important","code","isHack","embeddedContent","embedSize","join","totalUniqueDeclarations","totalSelectors","specificitiesA","specificitiesB","specificitiesC","complexityCount","totalUniqueSelectors","stylesheet","sourceLinesOfCode","linesOfCode","comments","ratio","atrules","fontface","import","media","charset","prefixed","container","layer","rules","empty","selectors","items","declarations","id","accessibility","importants","inKeyframes","custom","browserhacks","values","zindexes","animations","prefixes","__meta__","parseTime","analyzeTime"],"mappings":"8DAMA,SAASA,EAAYC,EAAeC,GAMlC,OAJIA,GAAY,IAAUA,GAAY,KAEpCA,GAAsB,IAEjBD,IAAkBC,WA2BXC,EAAS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wBD,MAIvEE,WAAYtF,GACVsF,GAAWjG,QAAS,CACpBsK,SAAU3J,GACRwF,GAAuBnG,QAAS,CAChCgK,MAA6B,IAAtB/D,GAAWjH,OAAe,EAAImH,GAAuBnH,OAASiH,GAAWjH,SAElFkM,OAAQvK,GACNyF,GAAiBpG,QAAS,CAC1BgK,MAA6B,IAAtB/D,GAAWjH,OAAe,EAAIoH,GAAiBpH,OAASiH,GAAWjH,SAE5EmM,aAAcxK,GACZuF,GAAclG,QAAS,CACvBgK,MAA6B,IAAtB/D,GAAWjH,OAAe,EAAIkH,GAAclH,OAASiH,GAAWjH,WAG3EoM,OAAQ,CACNvE,OAAQA,GAAO7G,QACfyG,aAAcA,GAAazG,QAC3B0G,UAAWA,GAAU1G,QACrBqL,SAAU/E,GAAOtG,QACjBuG,YAAaA,GAAYvG,QACzBwG,WAAYA,GAAWxG,QACvBsL,WAAY,CACV1E,UAAWA,GAAU5G,QACrB2G,gBAAiBA,GAAgB3G,SAEnCuL,SAAUlF,GAAqBrG,QAC/B8G,MAAOA,GAAM9G,SAEfwL,SAAU,CACRC,UAAWpH,EAAgBR,EAC3B6H,YAAa,IAAI3I,KAASsB,EAC1BpE,MAAO,IAAI8C,KAASD"}
|
|
1
|
+
{"version":3,"file":"analyzer.module.js","sources":["../src/string-utils.js","../src/atrules/atrules.js","../src/vendor-prefix.js","../src/selectors/specificity.js","../src/values/colors.js","../src/values/font-families.js","../src/values/font-sizes.js","../src/values/values.js","../src/values/animations.js","../src/values/vendor-prefix.js","../src/countable-collection.js","../src/context-collection.js","../src/aggregate-collection.js","../src/properties/property-utils.js","../src/occurrence-counter.js","../src/index.js"],"sourcesContent":["/**\n * Case-insensitive compare two character codes\n * @param {string} charA\n * @param {string} charB\n * @see https://github.com/csstree/csstree/blob/41f276e8862d8223eeaa01a3d113ab70bb13d2d9/lib/tokenizer/utils.js#L22\n */\nfunction compareChar(referenceCode, testCode) {\n // if uppercase\n if (testCode >= 0x0041 && testCode <= 0x005A) {\n // shifting the 6th bit makes a letter lowercase\n testCode = testCode | 32\n }\n return referenceCode === testCode\n}\n\n/**\n * Case-insensitive string-comparison\n * @param {string} base\n * @param {string} test\n * @returns {boolean} true if the two strings are the same, false otherwise\n */\nexport function strEquals(base, test) {\n if (base.length !== test.length) return false\n\n for (let i = 0; i < base.length; i++) {\n if (compareChar(base.charCodeAt(i), test.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Case-insensitive testing whether a string ends with a given substring\n * @param {string} base e.g. '-webkit-transform'\n * @param {string} cmp e.g. 'transform'\n * @returns {boolean} true if `test` ends with `base`, false otherwise\n */\nexport function endsWith(base, test) {\n const offset = test.length - base.length\n\n if (offset < 0) {\n return false\n }\n\n for (let i = test.length - 1; i >= offset; i--) {\n if (compareChar(base.charCodeAt(i - offset), test.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Case-insensitive testing whether a string starts with a given substring\n * @param {string} base\n * @param {test} test\n * @returns {boolean} true if `test` starts with `base`, false otherwise\n */\nexport function startsWith(base, test) {\n if (test.length < base.length) return false\n\n for (let i = 0; i < base.length; i++) {\n if (compareChar(base.charCodeAt(i), test.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n","import { strEquals, startsWith, endsWith } from '../string-utils.js'\nimport walk from 'css-tree/walker'\n\n/**\n * Check whether node.property === property and node.value === value,\n * but case-insensitive and fast.\n * @param {import('css-tree').Declaration} node\n * @param {string} property - The CSS property to compare with (case-insensitive)\n * @param {string} value - The identifier/keyword value to compare with\n * @returns true if declaratioNode is the given property: value, false otherwise\n */\nfunction isPropertyValue(node, property, value) {\n return strEquals(property, node.property)\n && node.value.children.first.type === 'Identifier'\n && strEquals(value, node.value.children.first.name)\n}\n\n/**\n * Check if an @supports atRule is a browserhack\n * @param {import('css-tree').AtrulePrelude} prelude\n * @returns true if the atrule is a browserhack\n */\nexport function isSupportsBrowserhack(prelude) {\n let returnValue = false\n\n walk(prelude, function (node) {\n if (node.type === 'Declaration') {\n if (\n isPropertyValue(node, '-webkit-appearance', 'none')\n || isPropertyValue(node, '-moz-appearance', 'meterbar')\n ) {\n returnValue = true\n return this.break\n }\n }\n })\n\n return returnValue\n}\n\n/**\n * Check if a @media atRule is a browserhack\n * @param {import('css-tree').AtrulePrelude} prelude\n * @returns true if the atrule is a browserhack\n */\nexport function isMediaBrowserhack(prelude) {\n let returnValue = false\n\n walk(prelude, function (node) {\n if (node.type === 'MediaQuery'\n && node.children.size === 1\n && node.children.first.type === 'Identifier'\n ) {\n node = node.children.first\n // Note: CSSTree adds a trailing space to \\\\9\n if (startsWith('\\\\0', node.name) || endsWith('\\\\9 ', node.name)) {\n returnValue = true\n return this.break\n }\n }\n if (node.type === 'MediaFeature') {\n if (node.value !== null && node.value.unit === '\\\\0') {\n returnValue = true\n return this.break\n }\n if (strEquals('-moz-images-in-menus', node.name)\n || strEquals('min--moz-device-pixel-ratio', node.name)\n || strEquals('-ms-high-contrast', node.name)\n ) {\n returnValue = true\n return this.break\n }\n if (strEquals('min-resolution', node.name)\n && strEquals('.001', node.value.value)\n && strEquals('dpcm', node.value.unit)\n ) {\n returnValue = true\n return this.break\n }\n if (strEquals('-webkit-min-device-pixel-ratio', node.name)) {\n if ((strEquals('0', node.value.value) || strEquals('10000', node.value.value))) {\n returnValue = true\n return this.break\n }\n }\n }\n })\n\n return returnValue\n}","const HYPHENMINUS = 45; // '-'.charCodeAt()\n\n/**\n * @param {string} keyword\n * @returns {boolean}\n */\nfunction hasVendorPrefix(keyword) {\n if (keyword.charCodeAt(0) === HYPHENMINUS && keyword.charCodeAt(1) !== HYPHENMINUS) {\n // String must have a 2nd occurrence of '-', at least at position 3 (offset=2)\n if (keyword.indexOf('-', 2) !== -1) {\n return true\n }\n }\n\n return false\n}\n\nexport {\n hasVendorPrefix\n}","import walk from 'css-tree/walker'\nimport { startsWith, strEquals } from '../string-utils.js'\nimport { hasVendorPrefix } from '../vendor-prefix.js'\n\nconst COMPLEXITY = 3\nconst IS_A11Y = 4\n\n/**\n * Compare specificity A to Specificity B\n * @param {[number,number,number]} a - Specificity A\n * @param {[number,number,number]} b - Specificity B\n * @returns {number} sortIndex - 0 when a==b, 1 when a<b, -1 when a>b\n */\nfunction compareSpecificity(a, b) {\n if (a[0] === b[0]) {\n if (a[1] === b[1]) {\n return b[2] - a[2]\n }\n\n return b[1] - a[1]\n }\n\n return b[0] - a[0]\n}\n\n/**\n *\n * @param {import('css-tree').SelectorList} selectorListAst\n * @returns {Selector} topSpecificitySelector\n */\nfunction selectorListSpecificities(selectorListAst) {\n const childSelectors = []\n walk(selectorListAst, {\n visit: 'Selector',\n enter(node) {\n childSelectors.push(analyzeSelector(node))\n }\n })\n\n return childSelectors.sort((a, b) => compareSpecificity([a[0], a[1], a[2]], [b[0], b[1], b[2]]))\n}\n\n/**\n * Get the Specificity for the AST of a Selector Node\n * @param {import('css-tree').Selector} ast - AST Node for a Selector\n * @return {[number, number, number, number, number]} - Array with SpecificityA, SpecificityB, SpecificityC, complexity, isA11y\n */\nconst analyzeSelector = (node) => {\n let A = 0\n let B = 0\n let C = 0\n let complexity = 0\n let isA11y = false\n\n walk(node, function (selector) {\n switch (selector.type) {\n case 'IdSelector': {\n A++\n complexity++\n break\n }\n case 'ClassSelector': {\n B++\n complexity++\n break\n }\n case 'AttributeSelector': {\n B++\n complexity++\n\n // Add 1 for [attr=value] (or any variation using *= $= ^= |= )\n if (Boolean(selector.value)) {\n complexity++\n }\n\n if (strEquals('role', selector.name.name) || startsWith('aria-', selector.name.name)) {\n isA11y = true\n }\n break\n }\n case 'PseudoElementSelector':\n case 'TypeSelector': {\n complexity++\n\n if (hasVendorPrefix(selector.name)) {\n complexity++\n }\n\n // 42 === '*'.charCodeAt(0)\n if (selector.name.charCodeAt(0) === 42 && selector.name.length === 1) {\n break\n }\n\n C++\n break\n }\n case 'PseudoClassSelector': {\n switch (selector.name) {\n case 'before':\n case 'after':\n case 'first-letter':\n case 'first-line': {\n C++\n complexity++\n return this.skip\n }\n\n // The specificity of an :is(), :not(), or :has() pseudo-class is\n // replaced by the specificity of the most specific complex\n // selector in its selector list argument.\n case 'where':\n case 'is':\n case 'has':\n case 'matches':\n case '-webkit-any':\n case '-moz-any':\n case 'not':\n case 'nth-child':\n case 'nth-last-child': {\n if (hasVendorPrefix(selector.name)) {\n complexity++\n }\n\n // The specificity of an :nth-child() or :nth-last-child() selector\n // is the specificity of the pseudo class itself (counting as one\n // pseudo-class selector) plus the specificity of the most\n // specific complex selector in its selector list argument (if any).\n if (selector.name === 'nth-child' || selector.name === 'nth-last-child') {\n // +1 for the pseudo class itself\n B++\n }\n\n const selectorList = selectorListSpecificities(selector)\n\n // Bail out for empty/non-existent :nth-child() params\n if (selectorList.length === 0) return\n\n // The specificity of a :where() pseudo-class is replaced by zero,\n // but it does count towards complexity.\n if (selector.name !== 'where') {\n const [topA, topB, topC] = selectorList[0]\n A += topA\n B += topB\n C += topC\n }\n\n for (let i = 0; i < selectorList.length; i++) {\n const listItem = selectorList[i]\n if (listItem[IS_A11Y] === 1) {\n isA11y = true\n }\n complexity += listItem[COMPLEXITY]\n }\n\n complexity++\n return this.skip\n }\n\n default: {\n // Regular pseudo classes have specificity [0,1,0]\n complexity++\n B++\n return this.skip\n }\n }\n }\n case 'Combinator': {\n complexity++\n break\n }\n }\n })\n\n return [\n A, B, C,\n complexity,\n isA11y ? 1 : 0,\n ]\n}\n\nexport {\n analyzeSelector,\n compareSpecificity,\n}","export const colorNames = {\n // CSS Named Colors\n // Spec: https://drafts.csswg.org/css-color/#named-colors\n aliceblue: 1,\n antiquewhite: 1,\n aqua: 1,\n aquamarine: 1,\n azure: 1,\n beige: 1,\n bisque: 1,\n black: 1,\n blanchedalmond: 1,\n blue: 1,\n blueviolet: 1,\n brown: 1,\n burlywood: 1,\n cadetblue: 1,\n chartreuse: 1,\n chocolate: 1,\n coral: 1,\n cornflowerblue: 1,\n cornsilk: 1,\n crimson: 1,\n cyan: 1,\n darkblue: 1,\n darkcyan: 1,\n darkgoldenrod: 1,\n darkgray: 1,\n darkgreen: 1,\n darkgrey: 1,\n darkkhaki: 1,\n darkmagenta: 1,\n darkolivegreen: 1,\n darkorange: 1,\n darkorchid: 1,\n darkred: 1,\n darksalmon: 1,\n darkseagreen: 1,\n darkslateblue: 1,\n darkslategray: 1,\n darkslategrey: 1,\n darkturquoise: 1,\n darkviolet: 1,\n deeppink: 1,\n deepskyblue: 1,\n dimgray: 1,\n dimgrey: 1,\n dodgerblue: 1,\n firebrick: 1,\n floralwhite: 1,\n forestgreen: 1,\n fuchsia: 1,\n gainsboro: 1,\n ghostwhite: 1,\n gold: 1,\n goldenrod: 1,\n gray: 1,\n green: 1,\n greenyellow: 1,\n grey: 1,\n honeydew: 1,\n hotpink: 1,\n indianred: 1,\n indigo: 1,\n ivory: 1,\n khaki: 1,\n lavender: 1,\n lavenderblush: 1,\n lawngreen: 1,\n lemonchiffon: 1,\n lightblue: 1,\n lightcoral: 1,\n lightcyan: 1,\n lightgoldenrodyellow: 1,\n lightgray: 1,\n lightgreen: 1,\n lightgrey: 1,\n lightpink: 1,\n lightsalmon: 1,\n lightseagreen: 1,\n lightskyblue: 1,\n lightslategray: 1,\n lightslategrey: 1,\n lightsteelblue: 1,\n lightyellow: 1,\n lime: 1,\n limegreen: 1,\n linen: 1,\n magenta: 1,\n maroon: 1,\n mediumaquamarine: 1,\n mediumblue: 1,\n mediumorchid: 1,\n mediumpurple: 1,\n mediumseagreen: 1,\n mediumslateblue: 1,\n mediumspringgreen: 1,\n mediumturquoise: 1,\n mediumvioletred: 1,\n midnightblue: 1,\n mintcream: 1,\n mistyrose: 1,\n moccasin: 1,\n navajowhite: 1,\n navy: 1,\n oldlace: 1,\n olive: 1,\n olivedrab: 1,\n orange: 1,\n orangered: 1,\n orchid: 1,\n palegoldenrod: 1,\n palegreen: 1,\n paleturquoise: 1,\n palevioletred: 1,\n papayawhip: 1,\n peachpuff: 1,\n peru: 1,\n pink: 1,\n plum: 1,\n powderblue: 1,\n purple: 1,\n rebeccapurple: 1,\n red: 1,\n rosybrown: 1,\n royalblue: 1,\n saddlebrown: 1,\n salmon: 1,\n sandybrown: 1,\n seagreen: 1,\n seashell: 1,\n sienna: 1,\n silver: 1,\n skyblue: 1,\n slateblue: 1,\n slategray: 1,\n slategrey: 1,\n snow: 1,\n springgreen: 1,\n steelblue: 1,\n tan: 1,\n teal: 1,\n thistle: 1,\n tomato: 1,\n turquoise: 1,\n violet: 1,\n wheat: 1,\n white: 1,\n whitesmoke: 1,\n yellow: 1,\n yellowgreen: 1,\n\n // CSS System Colors\n // Spec: https://drafts.csswg.org/css-color/#css-system-colors\n canvas: 1,\n canvastext: 1,\n linktext: 1,\n visitedtext: 1,\n activetext: 1,\n buttonface: 1,\n buttontext: 1,\n buttonborder: 1,\n field: 1,\n fieldtext: 1,\n highlight: 1,\n highlighttext: 1,\n selecteditem: 1,\n selecteditemtext: 1,\n mark: 1,\n marktext: 1,\n graytext: 1,\n\n // TODO: Deprecated CSS System colors\n // Spec: https://drafts.csswg.org/css-color/#deprecated-system-colors\n}\n\nexport const colorFunctions = {\n rgb: 1,\n rgba: 1,\n hsl: 1,\n hsla: 1,\n hwb: 1,\n lab: 1,\n lch: 1,\n oklab: 1,\n oklch: 1,\n color: 1,\n}\n","import walk from 'css-tree/walker'\n\nconst systemKeywords = {\n // Global CSS keywords\n 'inherit': 1,\n 'initial': 1,\n 'unset': 1,\n 'revert': 1,\n\n // System font keywords\n 'caption': 1,\n 'icon': 1,\n 'menu': 1,\n 'message-box': 1,\n 'small-caption': 1,\n 'status-bar': 1,\n}\n\nconst keywordDisallowList = {\n // font-weight, font-stretch, font-style\n 'normal': 1,\n\n // font-size keywords\n 'xx-small': 1,\n 'x-small': 1,\n 'small': 1,\n 'medium': 1,\n 'large': 1,\n 'x-large': 1,\n 'xx-large': 1,\n 'larger': 1,\n 'smaller': 1,\n\n // font-weight keywords\n 'bold': 1,\n 'bolder': 1,\n 'lighter': 1,\n\n // font-stretch keywords\n 'ultra-condensed': 1,\n 'extra-condensed': 1,\n 'condensed': 1,\n 'semi-condensed': 1,\n 'semi-expanded': 1,\n 'expanded': 1,\n 'extra-expanded': 1,\n 'ultra-expanded': 1,\n\n // font-style keywords\n 'italic': 1,\n 'oblique': 1,\n}\n\nconst COMMA = 44 // ','.charCodeAt(0) === 44\n\nexport function isFontFamilyKeyword(node) {\n const firstChild = node.children.first\n return firstChild.type === 'Identifier' && systemKeywords[firstChild.name]\n}\n\nexport function getFamilyFromFont(node, stringifyNode) {\n let parts = ''\n\n walk(node, {\n reverse: true,\n enter: function (fontNode) {\n if (fontNode.type === 'String') {\n const loc = fontNode.loc.start\n // Stringify the first character to get the correct quote character\n const quote = stringifyNode({\n loc: {\n start: {\n line: loc.line,\n column: loc.column\n },\n end: {\n line: loc.line,\n column: loc.column + 1\n }\n }\n })\n return parts = quote + fontNode.value + quote + parts\n }\n if (fontNode.type === 'Operator' && fontNode.value.charCodeAt(0) === COMMA) {\n return parts = fontNode.value + parts\n }\n if (fontNode.type === 'Identifier') {\n if (keywordDisallowList[fontNode.name]) {\n return this.skip\n }\n return parts = fontNode.name + parts\n }\n }\n })\n\n return parts\n}\n","import walk from 'css-tree/walker'\n\nconst sizeKeywords = {\n 'xx-small': 1,\n 'x-small': 1,\n 'small': 1,\n 'medium': 1,\n 'large': 1,\n 'x-large': 1,\n 'xx-large': 1,\n 'larger': 1,\n 'smaller': 1,\n}\n\nconst keywords = {\n // Global CSS keywords\n 'inherit': 1,\n 'initial': 1,\n 'unset': 1,\n 'revert': 1,\n\n // System font keywords\n 'caption': 1,\n 'icon': 1,\n 'menu': 1,\n 'message-box': 1,\n 'small-caption': 1,\n 'status-bar': 1,\n}\n\nconst ZERO = 48 // '0'.charCodeAt(0) === 48\nconst SLASH = 47 // '/'.charCodeAt(0) === 47\n\nexport function isFontSizeKeyword(node) {\n const firstChild = node.children.first\n return firstChild.type === 'Identifier' && keywords[firstChild.name]\n}\n\nexport function getSizeFromFont(node) {\n let operator = false\n let size\n\n walk(node, function (fontNode) {\n switch (fontNode.type) {\n case 'Number': {\n // Special case for `font: 0/0 a`\n if (fontNode.value.charCodeAt(0) === ZERO) {\n size = '0'\n return this.break\n }\n }\n case 'Operator': {\n if (fontNode.value.charCodeAt(0) === SLASH) {\n operator = true\n }\n break\n }\n case 'Dimension': {\n if (!operator) {\n size = fontNode.value + fontNode.unit\n return this.break\n }\n }\n case 'Identifier': {\n if (sizeKeywords[fontNode.name]) {\n size = fontNode.name\n return this.break\n }\n }\n }\n })\n\n return size\n}\n","const keywords = {\n 'auto': 1,\n 'inherit': 1,\n 'initial': 1,\n 'unset': 1,\n 'revert': 1,\n 'none': 1, // for `text-shadow`, `box-shadow` and `background`\n}\n\nexport function isValueKeyword(node) {\n if (!node.children) return false\n const firstChild = node.children.first\n if (!firstChild) return false\n\n if (node.children.size > 1) return false\n return firstChild.type === 'Identifier' && keywords[firstChild.name]\n}\n","const timingKeywords = {\n 'linear': 1,\n 'ease': 1,\n 'ease-in': 1,\n 'ease-out': 1,\n 'ease-in-out': 1,\n 'step-start': 1,\n 'step-end': 1,\n}\n\nexport function analyzeAnimation(children, stringifyNode) {\n let durationFound = false\n const durations = []\n const timingFunctions = []\n\n children.forEach(child => {\n // Right after a ',' we start over again\n if (child.type === 'Operator') {\n return durationFound = false\n }\n if (child.type === 'Dimension' && durationFound === false) {\n durationFound = true\n return durations.push(stringifyNode(child))\n }\n if (child.type === 'Identifier' && timingKeywords[child.name]) {\n return timingFunctions.push(stringifyNode(child))\n }\n if (child.type === 'Function'\n && (\n child.name === 'cubic-bezier' || child.name === 'steps'\n )\n ) {\n return timingFunctions.push(stringifyNode(child))\n }\n })\n\n return [durations, timingFunctions]\n}\n","import { hasVendorPrefix } from '../vendor-prefix.js'\n\nexport function isAstVendorPrefixed(node) {\n if (!node.children) {\n return false\n }\n\n const children = node.children.toArray()\n\n for (let index = 0; index < children.length; index++) {\n const node = children[index]\n const { type, name } = node;\n\n if (type === 'Identifier' && hasVendorPrefix(name)) {\n return true\n }\n\n if (type === 'Function') {\n if (hasVendorPrefix(name)) {\n return true\n }\n\n if (isAstVendorPrefixed(node)) {\n return true\n }\n }\n }\n\n return false\n}\n","class CountableCollection {\n /**\n * @param {string[]} initial\n */\n constructor(initial) {\n /** @type [index: string]: string */\n this._items = {}\n /** @type number */\n this._total = 0\n /** @type number */\n this._totalUnique = 0\n\n if (initial) {\n for (let i = 0; i < initial.length; i++) {\n this.push(initial[i])\n }\n }\n }\n\n /**\n * Push an item to the end of this collection\n * @param {string} item\n * @returns {void}\n */\n push(item) {\n this._total++\n\n if (this._items[item]) {\n this._items[item]++\n return\n }\n\n this._items[item] = 1\n this._totalUnique++\n }\n\n /**\n * Get the size of this collection\n * @returns {number} the size of this collection\n */\n size() {\n return this._total\n }\n\n /**\n * Get the counts of this collection, like total, uniques, etc.\n */\n count() {\n return {\n total: this._total,\n totalUnique: this._totalUnique,\n unique: this._items,\n uniquenessRatio: this._total === 0 ? 0 : this._totalUnique / this._total,\n }\n }\n}\n\nexport {\n CountableCollection\n}","import { CountableCollection } from './countable-collection.js'\n\nclass ContextCollection {\n constructor() {\n this._list = new CountableCollection()\n /** @type {[index; string]: CountableCollection} */\n this._contexts = {}\n }\n\n /**\n * Add an item to this _list's context\n * @param {string} item Item to push\n * @param {string} context Context to push Item to\n */\n push(item, context) {\n this._list.push(item)\n\n if (!this._contexts[context]) {\n this._contexts[context] = new CountableCollection()\n }\n\n this._contexts[context].push(item)\n }\n\n count() {\n const itemsPerContext = {}\n\n for (let context in this._contexts) {\n itemsPerContext[context] = this._contexts[context].count()\n }\n\n return Object.assign(this._list.count(), {\n itemsPerContext\n })\n }\n}\n\nexport {\n ContextCollection\n}","/**\n * Find the mode (most occurring value) in an array of Numbers\n * Takes the mean/average of multiple values if multiple values occur the same amount of times.\n *\n * @see https://github.com/angus-c/just/blob/684af9ca0c7808bc78543ec89379b1fdfce502b1/packages/array-mode/index.js\n * @param {Array} arr - Array to find the mode value for\n * @returns {Number} mode - The `mode` value of `arr`\n */\nfunction Mode(arr) {\n const frequencies = Object.create(null)\n let maxOccurrences = -1\n let maxOccurenceCount = 0\n let sum = 0\n\n for (let i = 0; i < arr.length; i++) {\n const element = arr[i]\n const updatedCount = (frequencies[element] || 0) + 1\n frequencies[element] = updatedCount\n\n if (updatedCount > maxOccurrences) {\n maxOccurrences = updatedCount\n maxOccurenceCount = 0\n sum = 0\n }\n\n if (updatedCount >= maxOccurrences) {\n maxOccurenceCount++\n sum += element\n }\n }\n\n return sum / maxOccurenceCount\n}\n\n/**\n * Find the middle number in an Array of Numbers\n * Returns the average of 2 numbers if the Array length is an even number\n * @see https://github.com/angus-c/just/blob/684af9ca0c7808bc78543ec89379b1fdfce502b1/packages/array-median/index.js\n * @param {Array} arr - A sorted Array\n * @returns {Number} - The array's Median\n */\nfunction Median(arr) {\n const middle = arr.length / 2\n const lowerMiddleRank = Math.floor(middle)\n\n if (middle !== lowerMiddleRank) {\n return arr[lowerMiddleRank]\n }\n return (arr[lowerMiddleRank] + arr[lowerMiddleRank - 1]) / 2\n}\n\nclass AggregateCollection {\n constructor() {\n /** @type number[] */\n this._items = []\n }\n\n /**\n * Add a new Integer at the end of this AggregateCollection\n * @param {number} item - The item to add\n */\n push(item) {\n this._items.push(item)\n }\n\n size() {\n return this._items.length\n }\n\n aggregate() {\n if (this._items.length === 0) {\n return {\n min: 0,\n max: 0,\n mean: 0,\n mode: 0,\n median: 0,\n range: 0,\n sum: 0,\n }\n }\n\n // TODO: can we avoid this sort()? It's slow\n /** @type Number[] */\n const sorted = this._items.slice().sort((a, b) => a - b)\n const min = sorted[0]\n const max = sorted[sorted.length - 1]\n\n const sum = this._items.reduce((total, num) => (total += num))\n const mode = Mode(this._items)\n const median = Median(sorted)\n\n return {\n min,\n max,\n mean: sum / this._items.length,\n mode,\n median,\n range: max - min,\n sum,\n }\n }\n\n /**\n * @returns {number[]} All _items in this collection\n */\n toArray() {\n return this._items\n }\n}\n\nexport {\n AggregateCollection\n}","import { hasVendorPrefix } from '../vendor-prefix.js'\nimport { endsWith } from '../string-utils.js'\n\n/**\n * @param {string} property\n * @see https://github.com/csstree/csstree/blob/master/lib/utils/names.js#L69\n */\nexport function isHack(property) {\n if (isCustom(property) || hasVendorPrefix(property)) return false\n\n let code = property.charCodeAt(0)\n\n return code === 47 // /\n || code === 95 // _\n || code === 43 // +\n || code === 42 // *\n || code === 38 // &\n || code === 36 // $\n || code === 35 // #\n}\n\nexport function isCustom(property) {\n if (property.length < 3) return false\n // 45 === '-'.charCodeAt(0)\n return property.charCodeAt(0) === 45 && property.charCodeAt(1) === 45\n}\n\nexport function isProperty(basename, property) {\n if (isCustom(property)) return false\n return endsWith(basename, property)\n}","/**\n * Convert a string to a number\n * @param {string} str\n * @returns {number} the hashed string\n * @see https://stackoverflow.com/a/51276700\n */\nfunction hash(str) {\n const prime = 403\n let hash = 167\n\n for (let i = 0; i < str.length; i++) {\n hash = hash ^ str.charCodeAt(i)\n hash *= prime\n }\n\n return hash\n}\n\nexport class OccurrenceCounter {\n constructor() {\n this._items = Object.create(null)\n }\n\n /**\n * Converting the CSS string to an integer because this collection potentially\n * becomes very large and storing the values as integers saves 10-70%\n *\n * @see https://github.com/projectwallace/css-analyzer/pull/242\n * @param {string} item\n * @returns {number} the count for this item\n */\n push(item) {\n const key = hash(item)\n\n if (this._items[key]) return\n this._items[key] = 1\n }\n\n count() {\n return Object.keys(this._items).length\n }\n}\n","import parse from 'css-tree/parser'\nimport walk from 'css-tree/walker'\nimport { isSupportsBrowserhack, isMediaBrowserhack } from './atrules/atrules.js'\nimport { analyzeSelector, compareSpecificity } from './selectors/specificity.js'\nimport { colorFunctions, colorNames } from './values/colors.js'\nimport { isFontFamilyKeyword, getFamilyFromFont } from './values/font-families.js'\nimport { isFontSizeKeyword, getSizeFromFont } from './values/font-sizes.js'\nimport { isValueKeyword } from './values/values.js'\nimport { analyzeAnimation } from './values/animations.js'\nimport { isAstVendorPrefixed } from './values/vendor-prefix.js'\nimport { ContextCollection } from './context-collection.js'\nimport { CountableCollection } from './countable-collection.js'\nimport { AggregateCollection } from './aggregate-collection.js'\nimport { strEquals, startsWith, endsWith } from './string-utils.js'\nimport { hasVendorPrefix } from './vendor-prefix.js'\nimport { isCustom, isHack, isProperty } from './properties/property-utils.js'\nimport { OccurrenceCounter } from './occurrence-counter.js'\n\nfunction ratio(part, total) {\n if (total === 0) return 0\n return part / total\n}\n\n/**\n * Analyze CSS\n * @param {string} css\n */\nconst analyze = (css) => {\n const start = Date.now()\n\n // We need all lines later on when we need to stringify the AST again\n // e.g. for Selectors\n const lines = css.split(/\\r?\\n/)\n\n /**\n * Recreate the authored CSS from a CSSTree node\n * @param {import('css-tree').CssNode} node - Node from CSSTree AST to stringify\n * @returns {string} str - The stringified node\n */\n function stringifyNode(node) {\n const start = node.loc.start\n const end = node.loc.end\n const lineCount = end.line - start.line\n\n // Single-line nodes\n if (lineCount === 0) {\n return lines[start.line - 1].substring(start.column - 1, end.column - 1)\n }\n\n // Multi-line nodes\n let value = ''\n\n for (let i = start.line; i <= end.line; i++) {\n const line = lines[i - 1]\n // First line\n if (i === start.line) {\n value += line.substring(start.column - 1) + '\\n'\n continue\n }\n // Last line\n if (i === end.line) {\n value += line.substring(0, end.column - 1)\n continue\n }\n // All lines in between first and last\n value += line + '\\n'\n }\n\n return value\n }\n\n // Stylesheet\n let totalComments = 0\n let commentsSize = 0\n const embeds = new CountableCollection()\n\n const startParse = Date.now()\n\n const ast = parse(css, {\n parseCustomProperty: true, // To find font-families, colors, etc.\n positions: true, // So we can use stringifyNode()\n onComment: function (comment) {\n totalComments++\n commentsSize += comment.length\n },\n })\n\n const startAnalysis = Date.now()\n\n // Atrules\n let totalAtRules = 0\n /** @type {string}[]} */\n const fontfaces = []\n const layers = new CountableCollection()\n const imports = new CountableCollection()\n const medias = new CountableCollection()\n const mediaBrowserhacks = new CountableCollection()\n const charsets = new CountableCollection()\n const supports = new CountableCollection()\n const supportsBrowserhacks = new CountableCollection()\n const keyframes = new CountableCollection()\n const prefixedKeyframes = new CountableCollection()\n const containers = new CountableCollection()\n\n // Rules\n let totalRules = 0\n let emptyRules = 0\n const ruleSizes = new AggregateCollection()\n const selectorsPerRule = new AggregateCollection()\n const declarationsPerRule = new AggregateCollection()\n\n // Selectors\n const keyframeSelectors = new CountableCollection()\n const uniqueSelectors = new OccurrenceCounter()\n /** @type [number,number,number] */\n let maxSpecificity\n /** @type [number,number,number] */\n let minSpecificity\n const specificityA = new AggregateCollection()\n const specificityB = new AggregateCollection()\n const specificityC = new AggregateCollection()\n const uniqueSpecificities = new CountableCollection()\n const selectorComplexities = new AggregateCollection()\n /** @type [number,number,number][] */\n const specificities = []\n const ids = new CountableCollection()\n const a11y = new CountableCollection()\n\n // Declarations\n const uniqueDeclarations = new OccurrenceCounter()\n let totalDeclarations = 0\n let importantDeclarations = 0\n let importantsInKeyframes = 0\n\n // Properties\n const properties = new CountableCollection()\n const propertyHacks = new CountableCollection()\n const propertyVendorPrefixes = new CountableCollection()\n const customProperties = new CountableCollection()\n const propertyComplexities = new AggregateCollection()\n\n // Values\n const vendorPrefixedValues = new CountableCollection()\n const valueBrowserhacks = new CountableCollection()\n const zindex = new CountableCollection()\n const textShadows = new CountableCollection()\n const boxShadows = new CountableCollection()\n const fontFamilies = new CountableCollection()\n const fontSizes = new CountableCollection()\n const timingFunctions = new CountableCollection()\n const durations = new CountableCollection()\n const colors = new ContextCollection()\n const units = new ContextCollection()\n\n walk(ast, function (node) {\n switch (node.type) {\n case 'Atrule': {\n totalAtRules++\n const atRuleName = node.name\n\n if (atRuleName === 'font-face') {\n /** @type {[index: string]: string} */\n const descriptors = {}\n\n node.block.children.forEach(\n /** @param {import('css-tree').Declaration} descriptor */\n descriptor => (descriptors[descriptor.property] = stringifyNode(descriptor.value))\n )\n\n fontfaces.push(descriptors)\n break\n }\n\n if (atRuleName === 'media') {\n const prelude = stringifyNode(node.prelude)\n medias.push(prelude)\n if (isMediaBrowserhack(node.prelude)) {\n mediaBrowserhacks.push(prelude)\n }\n break\n }\n if (atRuleName === 'supports') {\n const prelude = stringifyNode(node.prelude)\n supports.push(prelude)\n if (isSupportsBrowserhack(node.prelude)) {\n supportsBrowserhacks.push(prelude)\n }\n break\n }\n if (endsWith('keyframes', atRuleName)) {\n const name = '@' + atRuleName + ' ' + stringifyNode(node.prelude)\n if (hasVendorPrefix(atRuleName)) {\n prefixedKeyframes.push(name)\n }\n keyframes.push(name)\n break\n }\n if (atRuleName === 'import') {\n imports.push(stringifyNode(node.prelude))\n break\n }\n if (atRuleName === 'charset') {\n charsets.push(stringifyNode(node.prelude))\n break\n }\n if (atRuleName === 'container') {\n containers.push(stringifyNode(node.prelude))\n break\n }\n if (atRuleName === 'layer') {\n const prelude = stringifyNode(node.prelude)\n prelude.trim()\n .split(',')\n .forEach(name => layers.push(name.trim()))\n }\n break\n }\n case 'Rule': {\n const numSelectors = node.prelude.children ? node.prelude.children.size : 0\n const numDeclarations = node.block.children ? node.block.children.size : 0\n\n ruleSizes.push(numSelectors + numDeclarations)\n selectorsPerRule.push(numSelectors)\n declarationsPerRule.push(numDeclarations)\n\n totalRules++\n\n if (numDeclarations === 0) {\n emptyRules++\n }\n break\n }\n case 'Selector': {\n const selector = stringifyNode(node)\n\n if (this.atrule && endsWith('keyframes', this.atrule.name)) {\n keyframeSelectors.push(selector)\n return this.skip\n }\n\n const analysis = analyzeSelector(node)\n const specificity = analysis.splice(0, 3)\n const [complexity, isA11y] = analysis\n\n if (specificity[0] > 0) {\n ids.push(selector)\n }\n\n if (isA11y === 1) {\n a11y.push(selector)\n }\n\n uniqueSelectors.push(selector)\n selectorComplexities.push(complexity)\n uniqueSpecificities.push(specificity)\n\n if (maxSpecificity === undefined) {\n maxSpecificity = specificity\n }\n\n if (minSpecificity === undefined) {\n minSpecificity = specificity\n }\n\n specificityA.push(specificity[0])\n specificityB.push(specificity[1])\n specificityC.push(specificity[2])\n\n if (minSpecificity !== undefined && compareSpecificity(minSpecificity, specificity) < 0) {\n minSpecificity = specificity\n }\n\n if (maxSpecificity !== undefined && compareSpecificity(maxSpecificity, specificity) > 0) {\n maxSpecificity = specificity\n }\n\n specificities.push(specificity)\n\n // Avoid deeper walking of selectors to not mess with\n // our specificity calculations in case of a selector\n // with :where() or :is() that contain SelectorLists\n // as children\n return this.skip\n }\n case 'Dimension': {\n if (!this.declaration) {\n break\n }\n\n units.push(node.unit, this.declaration.property)\n\n return this.skip\n }\n case 'Url': {\n if (startsWith('data:', node.value)) {\n embeds.push(node.value)\n }\n break\n }\n case 'Value': {\n if (isValueKeyword(node)) {\n break\n }\n\n const declaration = this.declaration\n const { property, important } = declaration\n\n if (isAstVendorPrefixed(node)) {\n vendorPrefixedValues.push(stringifyNode(node))\n }\n\n // i.e. `property: value !ie`\n if (typeof important === 'string') {\n valueBrowserhacks.push(stringifyNode(node) + '!' + important)\n }\n\n // i.e. `property: value\\9`\n if (node.children\n && node.children.last\n && node.children.last.type === 'Identifier'\n && endsWith('\\\\9', node.children.last.name)\n ) {\n valueBrowserhacks.push(stringifyNode(node))\n }\n\n // Process properties first that don't have colors,\n // so we can avoid further walking them;\n if (isProperty('z-index', property)) {\n if (!isValueKeyword(node)) {\n zindex.push(stringifyNode(node))\n }\n return this.skip\n } else if (isProperty('font', property)) {\n if (!isFontFamilyKeyword(node)) {\n fontFamilies.push(getFamilyFromFont(node, stringifyNode))\n }\n if (!isFontSizeKeyword(node)) {\n const size = getSizeFromFont(node)\n if (size) {\n fontSizes.push(size)\n }\n }\n break\n } else if (isProperty('font-size', property)) {\n if (!isFontSizeKeyword(node)) {\n fontSizes.push(stringifyNode(node))\n }\n break\n } else if (isProperty('font-family', property)) {\n if (!isFontFamilyKeyword(node)) {\n fontFamilies.push(stringifyNode(node))\n }\n break\n } else if (isProperty('transition', property) || isProperty('animation', property)) {\n const [times, fns] = analyzeAnimation(node.children, stringifyNode)\n for (let i = 0; i < times.length; i++) {\n durations.push(times[i])\n }\n for (let i = 0; i < fns.length; i++) {\n timingFunctions.push(fns[i])\n }\n break\n } else if (isProperty('animation-duration', property) || isProperty('transition-duration', property)) {\n durations.push(stringifyNode(node))\n break\n } else if (isProperty('transition-timing-function', property) || isProperty('animation-timing-function', property)) {\n timingFunctions.push(stringifyNode(node))\n break\n } else if (isProperty('text-shadow', property)) {\n if (!isValueKeyword(node)) {\n textShadows.push(stringifyNode(node))\n }\n // no break here: potentially contains colors\n } else if (isProperty('box-shadow', property)) {\n if (!isValueKeyword(node)) {\n boxShadows.push(stringifyNode(node))\n }\n // no break here: potentially contains colors\n }\n\n walk(node, function (valueNode) {\n switch (valueNode.type) {\n case 'Hash': {\n colors.push('#' + valueNode.value, property)\n\n return this.skip\n }\n case 'Identifier': {\n const { name } = valueNode\n // Bail out if it can't be a color name\n // 20 === 'lightgoldenrodyellow'.length\n // 3 === 'red'.length\n if (name.length > 20 || name.length < 3) {\n return this.skip\n }\n if (colorNames[name.toLowerCase()]) {\n colors.push(stringifyNode(valueNode), property)\n }\n return this.skip\n }\n case 'Function': {\n // Don't walk var() multiple times\n if (strEquals('var', valueNode.name)) {\n return this.skip\n }\n if (colorFunctions[valueNode.name.toLowerCase()]) {\n colors.push(stringifyNode(valueNode), property)\n }\n // No this.skip here intentionally,\n // otherwise we'll miss colors in linear-gradient() etc.\n }\n }\n })\n break\n }\n case 'Declaration': {\n // Do not process Declarations in atRule preludes\n // because we will handle them manually\n if (this.atrulePrelude !== null) {\n return this.skip\n }\n\n totalDeclarations++\n\n const declaration = stringifyNode(node)\n uniqueDeclarations.push(declaration)\n\n if (node.important === true) {\n importantDeclarations++\n\n if (this.atrule && endsWith('keyframes', this.atrule.name)) {\n importantsInKeyframes++\n }\n }\n\n const { property } = node\n\n properties.push(property)\n\n if (hasVendorPrefix(property)) {\n propertyVendorPrefixes.push(property)\n propertyComplexities.push(2)\n } else if (isHack(property)) {\n propertyHacks.push(property)\n propertyComplexities.push(2)\n } else if (isCustom(property)) {\n customProperties.push(property)\n propertyComplexities.push(2)\n } else {\n propertyComplexities.push(1)\n }\n break\n }\n }\n })\n\n const embeddedContent = embeds.count()\n const embedSize = Object.keys(embeddedContent.unique).join('').length\n\n const totalUniqueDeclarations = uniqueDeclarations.count()\n\n const totalSelectors = selectorComplexities.size()\n const specificitiesA = specificityA.aggregate()\n const specificitiesB = specificityB.aggregate()\n const specificitiesC = specificityC.aggregate()\n const uniqueSpecificitiesCount = uniqueSpecificities.count()\n const complexityCount = new CountableCollection(selectorComplexities.toArray()).count()\n const totalUniqueSelectors = uniqueSelectors.count()\n const uniqueRuleSize = new CountableCollection(ruleSizes.toArray()).count()\n const uniqueSelectorsPerRule = new CountableCollection(selectorsPerRule.toArray()).count()\n const uniqueDeclarationsPerRule = new CountableCollection(declarationsPerRule.toArray()).count()\n const assign = Object.assign\n\n return {\n stylesheet: {\n sourceLinesOfCode: totalAtRules + totalSelectors + totalDeclarations + keyframeSelectors.size(),\n linesOfCode: lines.length,\n size: css.length,\n comments: {\n total: totalComments,\n size: commentsSize,\n },\n embeddedContent: assign(embeddedContent, {\n size: {\n total: embedSize,\n ratio: ratio(embedSize, css.length),\n },\n }),\n },\n atrules: {\n fontface: {\n total: fontfaces.length,\n totalUnique: fontfaces.length,\n unique: fontfaces,\n uniquenessRatio: fontfaces.length === 0 ? 0 : 1\n },\n import: imports.count(),\n media: assign(\n medias.count(),\n {\n browserhacks: mediaBrowserhacks.count(),\n }\n ),\n charset: charsets.count(),\n supports: assign(\n supports.count(),\n {\n browserhacks: supportsBrowserhacks.count(),\n },\n ),\n keyframes: assign(\n keyframes.count(), {\n prefixed: assign(\n prefixedKeyframes.count(), {\n ratio: ratio(prefixedKeyframes.size(), keyframes.size())\n }),\n }),\n container: containers.count(),\n layer: layers.count(),\n },\n rules: {\n total: totalRules,\n empty: {\n total: emptyRules,\n ratio: ratio(emptyRules, totalRules)\n },\n sizes: assign(\n ruleSizes.aggregate(),\n {\n items: ruleSizes.toArray(),\n unique: uniqueRuleSize.unique,\n totalUnique: uniqueRuleSize.totalUnique,\n uniquenessRatio: uniqueRuleSize.uniquenessRatio\n },\n ),\n selectors: assign(\n selectorsPerRule.aggregate(),\n {\n items: selectorsPerRule.toArray(),\n unique: uniqueSelectorsPerRule.unique,\n totalUnique: uniqueSelectorsPerRule.totalUnique,\n uniquenessRatio: uniqueSelectorsPerRule.uniquenessRatio\n },\n ),\n declarations: assign(\n declarationsPerRule.aggregate(),\n {\n items: declarationsPerRule.toArray(),\n unique: uniqueDeclarationsPerRule.unique,\n totalUnique: uniqueDeclarationsPerRule.totalUnique,\n uniquenessRatio: uniqueDeclarationsPerRule.uniquenessRatio,\n },\n ),\n },\n selectors: {\n total: totalSelectors,\n totalUnique: totalUniqueSelectors,\n uniquenessRatio: ratio(totalUniqueSelectors, totalSelectors),\n specificity: {\n /** @type [number, number, number] */\n min: minSpecificity === undefined ? [0, 0, 0] : minSpecificity,\n /** @type [number, number, number] */\n max: maxSpecificity === undefined ? [0, 0, 0] : maxSpecificity,\n /** @type [number, number, number] */\n sum: [specificitiesA.sum, specificitiesB.sum, specificitiesC.sum],\n /** @type [number, number, number] */\n mean: [specificitiesA.mean, specificitiesB.mean, specificitiesC.mean],\n /** @type [number, number, number] */\n mode: [specificitiesA.mode, specificitiesB.mode, specificitiesC.mode],\n /** @type [number, number, number] */\n median: [specificitiesA.median, specificitiesB.median, specificitiesC.median],\n items: specificities,\n unique: uniqueSpecificitiesCount.unique,\n totalUnique: uniqueSpecificitiesCount.totalUnique,\n uniquenessRatio: uniqueSpecificitiesCount.uniquenessRatio,\n },\n complexity: assign(\n selectorComplexities.aggregate(),\n complexityCount, {\n items: selectorComplexities.toArray(),\n }),\n id: assign(\n ids.count(), {\n ratio: ratio(ids.size(), totalSelectors),\n }),\n accessibility: assign(\n a11y.count(), {\n ratio: ratio(a11y.size(), totalSelectors),\n }),\n keyframes: keyframeSelectors.count(),\n },\n declarations: {\n total: totalDeclarations,\n totalUnique: totalUniqueDeclarations,\n uniquenessRatio: ratio(totalUniqueDeclarations, totalDeclarations),\n // @TODO: deprecated, remove in next major version\n unique: {\n total: totalUniqueDeclarations,\n ratio: ratio(totalUniqueDeclarations, totalDeclarations),\n },\n importants: {\n total: importantDeclarations,\n ratio: ratio(importantDeclarations, totalDeclarations),\n inKeyframes: {\n total: importantsInKeyframes,\n ratio: ratio(importantsInKeyframes, importantDeclarations),\n },\n },\n },\n properties: assign(\n properties.count(), {\n prefixed: assign(\n propertyVendorPrefixes.count(), {\n ratio: ratio(propertyVendorPrefixes.size(), properties.size()),\n }),\n custom: assign(\n customProperties.count(), {\n ratio: ratio(customProperties.size(), properties.size()),\n }),\n browserhacks: assign(\n propertyHacks.count(), {\n ratio: ratio(propertyHacks.size(), properties.size()),\n }),\n complexity: propertyComplexities.aggregate(),\n }),\n values: {\n colors: colors.count(),\n fontFamilies: fontFamilies.count(),\n fontSizes: fontSizes.count(),\n zindexes: zindex.count(),\n textShadows: textShadows.count(),\n boxShadows: boxShadows.count(),\n animations: {\n durations: durations.count(),\n timingFunctions: timingFunctions.count(),\n },\n prefixes: vendorPrefixedValues.count(),\n browserhacks: valueBrowserhacks.count(),\n units: units.count(),\n },\n __meta__: {\n parseTime: startAnalysis - startParse,\n analyzeTime: Date.now() - startAnalysis,\n total: Date.now() - start\n }\n }\n}\n\nexport {\n analyze,\n compareSpecificity,\n}\n"],"names":["compareChar","referenceCode","testCode","strEquals","base","test","length","i","charCodeAt","endsWith","offset","startsWith","isPropertyValue","node","property","value","children","first","type","name","hasVendorPrefix","keyword","indexOf","compareSpecificity","a","b","analyzeSelector","A","B","C","complexity","isA11y","walk","selector","Boolean","skip","selectorList","childSelectors","visit","enter","push","sort","listItem","colorNames","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","canvas","canvastext","linktext","visitedtext","activetext","buttonface","buttontext","buttonborder","field","fieldtext","highlight","highlighttext","selecteditem","selecteditemtext","mark","marktext","graytext","colorFunctions","rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","systemKeywords","inherit","initial","unset","revert","caption","icon","menu","keywordDisallowList","normal","small","medium","large","larger","smaller","bold","bolder","lighter","condensed","expanded","italic","oblique","isFontFamilyKeyword","firstChild","sizeKeywords","keywords","isFontSizeKeyword","auto","none","isValueKeyword","size","timingKeywords","linear","ease","isAstVendorPrefixed","toArray","index","CountableCollection","this","_items","_total","_totalUnique","item","count","total","totalUnique","unique","uniquenessRatio","ContextCollection","_list","_contexts","context","itemsPerContext","Object","assign","AggregateCollection","aggregate","min","max","mean","mode","median","range","sum","arr","middle","lowerMiddleRank","sorted","slice","reduce","num","frequencies","create","maxOccurrences","maxOccurenceCount","element","updatedCount","Mode","Math","floor","isCustom","isProperty","basename","OccurrenceCounter","key","str","hash","keys","ratio","part","analyze","css","start","Date","now","lines","split","stringifyNode","loc","end","line","substring","column","maxSpecificity","minSpecificity","totalComments","commentsSize","embeds","startParse","ast","parse","parseCustomProperty","positions","onComment","comment","startAnalysis","totalAtRules","fontfaces","layers","imports","medias","mediaBrowserhacks","charsets","supports","supportsBrowserhacks","keyframes","prefixedKeyframes","containers","totalRules","emptyRules","ruleSizes","selectorsPerRule","declarationsPerRule","keyframeSelectors","uniqueSelectors","specificityA","specificityB","specificityC","uniqueSpecificities","selectorComplexities","specificities","ids","a11y","uniqueDeclarations","totalDeclarations","importantDeclarations","importantsInKeyframes","properties","propertyHacks","propertyVendorPrefixes","customProperties","propertyComplexities","vendorPrefixedValues","valueBrowserhacks","zindex","textShadows","boxShadows","fontFamilies","fontSizes","timingFunctions","durations","colors","units","atRuleName","descriptors","block","forEach","descriptor","prelude","returnValue","unit","isMediaBrowserhack","isSupportsBrowserhack","trim","numSelectors","numDeclarations","atrule","analysis","specificity","splice","undefined","declaration","important","last","parts","reverse","fontNode","quote","getFamilyFromFont","operator","getSizeFromFont","durationFound","child","analyzeAnimation","times","fns","valueNode","toLowerCase","atrulePrelude","code","isHack","embeddedContent","embedSize","join","totalUniqueDeclarations","totalSelectors","specificitiesA","specificitiesB","specificitiesC","uniqueSpecificitiesCount","complexityCount","totalUniqueSelectors","uniqueRuleSize","uniqueSelectorsPerRule","uniqueDeclarationsPerRule","stylesheet","sourceLinesOfCode","linesOfCode","comments","atrules","fontface","import","media","browserhacks","charset","prefixed","container","layer","rules","empty","sizes","items","selectors","declarations","id","accessibility","importants","inKeyframes","custom","values","zindexes","animations","prefixes","__meta__","parseTime","analyzeTime"],"mappings":"8DAMA,SAASA,EAAYC,EAAeC,GAMlC,OAJIA,GAAY,IAAUA,GAAY,KAEpCA,GAAsB,IAEjBD,IAAkBC,CAC1B,UAQeC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GAAkB9G,QAChCuH,MAAOA,GAAMvH,SAEfwM,SAAU,CACRC,UAAWjI,EAAgBP,EAC3ByI,YAAaxJ,KAAKC,MAAQqB,EAC1BvE,MAAOiD,KAAKC,MAAQF,GAGzB"}
|
package/dist/analyzer.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("css-tree/parser"),require("css-tree/walker")):"function"==typeof define&&define.amd?define(["exports","css-tree/parser","css-tree/walker"],t):t((e||self).cssAnalyzer={},e.parse,e.walk)}(this,function(e,t,r){function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=/*#__PURE__*/n(t),a=/*#__PURE__*/n(r);function o(e,t){return t>=65&&t<=90&&(t|=32),e===t}function s(e,t){var r=t.length-e.length;if(r<0)return!1;for(var n=t.length-1;n>=r;n--)if(!1===o(e.charCodeAt(n-r),t.charCodeAt(n)))return!1;return!0}function u(e,t){if(t.length<e.length)return!1;for(var r=0;r<e.length;r++)if(!1===o(e.charCodeAt(r),t.charCodeAt(r)))return!1;return!0}function l(e,t){return e[0]===t[0]?e[1]===t[1]?t[2]-e[2]:t[1]-e[1]:t[0]-e[0]}var c=function(e){var t=0,r=0,n=0,i=0,o=!1;return a.default(e,function(e){switch(e.type){case"IdSelector":t++,i++;break;case"ClassSelector":r++,i++;break;case"AttributeSelector":r++,i++,Boolean(e.value)&&i++,o="role"===e.name.name||u("aria-",e.name.name);break;case"PseudoElementSelector":case"TypeSelector":if(i++,42===e.name.charCodeAt(0)&&1===e.name.length)break;n++;break;case"PseudoClassSelector":switch(e.name){case"before":case"after":case"first-letter":case"first-line":return n++,i++,this.skip;case"where":case"is":case"has":case"matches":case"-webkit-any":case"-moz-any":case"not":case"nth-child":case"nth-last-child":"nth-child"!==e.name&&"nth-last-child"!==e.name||r++;var s=(m=[],a.default(e,{visit:"Selector",enter:function(e){m.push(c(e))}}),m.sort(function(e,t){return l(e.specificity,t.specificity)}));if(0===s.length)return;if("where"!==e.name){var f=s[0].specificity;t+=f[0],r+=f[1],n+=f[2]}for(var d=0;d<s.length;d++){var h=s[d];h.isA11y&&(o=!0),i+=h.complexity}return i++,this.skip;default:return i++,r++,this.skip}case"Combinator":i++}var m}),{specificity:[t,r,n],complexity:i,isId:t>0,isA11y:o}},f={aliceblue:1,antiquewhite:1,aqua:1,aquamarine:1,azure:1,beige:1,bisque:1,black:1,blanchedalmond:1,blue:1,blueviolet:1,brown:1,burlywood:1,cadetblue:1,chartreuse:1,chocolate:1,coral:1,cornflowerblue:1,cornsilk:1,crimson:1,cyan:1,darkblue:1,darkcyan:1,darkgoldenrod:1,darkgray:1,darkgreen:1,darkgrey:1,darkkhaki:1,darkmagenta:1,darkolivegreen:1,darkorange:1,darkorchid:1,darkred:1,darksalmon:1,darkseagreen:1,darkslateblue:1,darkslategray:1,darkslategrey:1,darkturquoise:1,darkviolet:1,deeppink:1,deepskyblue:1,dimgray:1,dimgrey:1,dodgerblue:1,firebrick:1,floralwhite:1,forestgreen:1,fuchsia:1,gainsboro:1,ghostwhite:1,gold:1,goldenrod:1,gray:1,green:1,greenyellow:1,grey:1,honeydew:1,hotpink:1,indianred:1,indigo:1,ivory:1,khaki:1,lavender:1,lavenderblush:1,lawngreen:1,lemonchiffon:1,lightblue:1,lightcoral:1,lightcyan:1,lightgoldenrodyellow:1,lightgray:1,lightgreen:1,lightgrey:1,lightpink:1,lightsalmon:1,lightseagreen:1,lightskyblue:1,lightslategray:1,lightslategrey:1,lightsteelblue:1,lightyellow:1,lime:1,limegreen:1,linen:1,magenta:1,maroon:1,mediumaquamarine:1,mediumblue:1,mediumorchid:1,mediumpurple:1,mediumseagreen:1,mediumslateblue:1,mediumspringgreen:1,mediumturquoise:1,mediumvioletred:1,midnightblue:1,mintcream:1,mistyrose:1,moccasin:1,navajowhite:1,navy:1,oldlace:1,olive:1,olivedrab:1,orange:1,orangered:1,orchid:1,palegoldenrod:1,palegreen:1,paleturquoise:1,palevioletred:1,papayawhip:1,peachpuff:1,peru:1,pink:1,plum:1,powderblue:1,purple:1,rebeccapurple:1,red:1,rosybrown:1,royalblue:1,saddlebrown:1,salmon:1,sandybrown:1,seagreen:1,seashell:1,sienna:1,silver:1,skyblue:1,slateblue:1,slategray:1,slategrey:1,snow:1,springgreen:1,steelblue:1,tan:1,teal:1,thistle:1,tomato:1,turquoise:1,violet:1,wheat:1,white:1,whitesmoke:1,yellow:1,yellowgreen:1,canvas:1,canvastext:1,linktext:1,visitedtext:1,activetext:1,buttonface:1,buttontext:1,buttonborder:1,field:1,fieldtext:1,highlight:1,highlighttext:1,selecteditem:1,selecteditemtext:1,mark:1,marktext:1,graytext:1},d={rgb:1,rgba:1,hsl:1,hsla:1,hwb:1,lab:1,lch:1,oklab:1,oklch:1,color:1},h={inherit:1,initial:1,unset:1,revert:1,caption:1,icon:1,menu:1,"message-box":1,"small-caption":1,"status-bar":1},m={normal:1,"xx-small":1,"x-small":1,small:1,medium:1,large:1,"x-large":1,"xx-large":1,larger:1,smaller:1,bold:1,bolder:1,lighter:1,"ultra-condensed":1,"extra-condensed":1,condensed:1,"semi-condensed":1,"semi-expanded":1,expanded:1,"extra-expanded":1,"ultra-expanded":1,italic:1,oblique:1};function b(e){var t=e.children.first;return"Identifier"===t.type&&h[t.name]}var v={"xx-small":1,"x-small":1,small:1,medium:1,large:1,"x-large":1,"xx-large":1,larger:1,smaller:1},g={inherit:1,initial:1,unset:1,revert:1,caption:1,icon:1,menu:1,"message-box":1,"small-caption":1,"status-bar":1};function w(e){var t=e.children.first;return"Identifier"===t.type&&g[t.name]}var k={auto:1,inherit:1,initial:1,unset:1,revert:1,none:1};function p(e){if(!e.children)return!1;var t=e.children.first;return!!t&&!(e.children.size>1)&&"Identifier"===t.type&&k[t.name]}var y={linear:1,ease:1,"ease-in":1,"ease-out":1,"ease-in-out":1,"step-start":1,"step-end":1};function x(e){return 45===e.charCodeAt(0)&&45!==e.charCodeAt(1)&&-1!==e.indexOf("-",2)}function q(e){if(!e.children)return!1;for(var t=e.children.toArray(),r=0;r<t.length;r++){var n=t[r],i=n.type,a=n.name;if("Identifier"===i&&x(a))return!0;if("Function"===i){if(x(a))return!0;if(q(n))return!0}}return!1}var S=/*#__PURE__*/function(){function e(e){if(this.t={},this.i=0,this.o=0,e)for(var t=0;t<e.length;t++)this.push(e[t])}var t=e.prototype;return t.push=function(e){this.i++,this.t[e]?this.t[e]++:(this.t[e]=1,this.o++)},t.size=function(){return this.i},t.count=function(){return{total:this.i,totalUnique:this.o,unique:this.t,uniquenessRatio:0===this.i?0:this.o/this.i}},e}(),z=/*#__PURE__*/function(){function e(){this.u=new S,this.l={}}var t=e.prototype;return t.push=function(e,t){this.u.push(e),this.l[t]||(this.l[t]=new S),this.l[t].push(e)},t.count=function(){var e={};for(var t in this.l)e[t]=this.l[t].count();return Object.assign(this.u.count(),{itemsPerContext:e})},e}(),O=/*#__PURE__*/function(){function e(){this.t=[]}var t=e.prototype;return t.add=function(e){this.t.push(e)},t.size=function(){return this.t.length},t.aggregate=function(){if(0===this.t.length)return{min:0,max:0,mean:0,mode:0,median:0,range:0,sum:0};var e,t,r,n=this.t.slice().sort(function(e,t){return e-t}),i=n[0],a=n[n.length-1],o=this.t.reduce(function(e,t){return e+t}),s=function(e){for(var t=Object.create(null),r=-1,n=0,i=0,a=0;a<e.length;a++){var o=e[a],s=(t[o]||0)+1;t[o]=s,s>r&&(r=s,n=0,i=0),s>=r&&(n++,i+=o)}return i/n}(this.t),u=(t=(e=n).length/2)!==(r=Math.floor(t))?e[r]:(e[r]+e[r-1])/2;return{min:i,max:a,mean:o/this.t.length,mode:s,median:u,range:a-i,sum:o}},t.toArray=function(){return this.t},e}();function D(e){return!(e.length<3)&&45===e.charCodeAt(0)&&45===e.charCodeAt(1)}function I(e,t){return!D(t)&&s(e,t)}var j=/*#__PURE__*/function(){function e(){this.t=Object.create(null)}var t=e.prototype;return t.push=function(e){return this.t[e]?this.t[e]++:this.t[e]=1},t.count=function(){return Object.keys(this.t).length},e}();e.analyze=function(e){var t=new Date,r=e.split(/\r?\n/);function n(e){var t=e.loc.start,n=e.loc.end;if(0==n.line-t.line)return r[t.line-1].substring(t.column-1,n.column-1);for(var i="",a=t.line;a<=n.line;a++){var o=r[a-1];i+=a!==t.line?a!==n.line?o+"\n":o.substring(0,n.column-1):o.substring(t.column-1)+"\n"}return i}var h,g,k=0,C=0,F=new S,P=new Date,T=i.default(e,{parseAtrulePrelude:!1,parseCustomProperty:!0,positions:!0,onComment:function(e){k++,C+=e.length}}),A=new Date,R=0,U=[],_=new S,B=new S,E=new S,H=new S,K=new S,L=new S,M=new S,N=new S,V=0,G=0,J=new O,Q=new O,W=new S,X=new j,Y=new O,Z=new O,$=new O,ee=new O,te=[],re=new S,ne=new S,ie=new j,ae=0,oe=0,se=0,ue=new S,le=new S,ce=new S,fe=new S,de=new S,he=new S,me=new S,be=new S,ve=new S,ge=new S,we=new S,ke=new S,pe=new z,ye=new z;a.default(T,function(e){switch(e.type){case"Atrule":R++;var t=e.name;if("font-face"===t){var r={};e.block.children.forEach(function(e){return r[e.property]=n(e.value)}),U.push(r);break}if("media"===t){E.push(e.prelude.value);break}if("supports"===t){K.push(e.prelude.value);break}if(s("keyframes",t)){var i="@"+t+" "+e.prelude.value;x(t)&&M.push(i),L.push(i);break}if("import"===t){B.push(e.prelude.value);break}if("charset"===t){H.push(e.prelude.value);break}if("container"===t){N.push(e.prelude.value);break}"layer"===t&&N.push(e.prelude.value.trim().split(",").map(function(e){return e.trim()}).forEach(function(e){return _.push(e)}));break;case"Rule":var k=function(e){var t=0,r=0;return a.default(e,function(e){return"Selector"===e.type?(t++,this.skip):"Declaration"===e.type?(r++,this.skip):void 0}),[t,r]}(e),S=k[1];V++,0===S&&G++,J.add(k[0]),Q.add(S);break;case"Selector":var z=n(e);if(this.atrule&&s("keyframes",this.atrule.name))return W.push(z),this.skip;var O=c(e),j=O.specificity,C=O.complexity,P=O.isA11y;return O.isId&&re.push(z),P&&ne.push(z),X.push(z),ee.add(C),void 0===h&&(h=j),void 0===g&&(g=j),Y.add(j[0]),Z.add(j[1]),$.add(j[2]),void 0!==g&&l(g,j)<0&&(g=j),void 0!==h&&l(h,j)>0&&(h=j),te.push(j),this.skip;case"Dimension":if(!this.declaration)break;return ye.push(e.unit,this.declaration.property),this.skip;case"Url":u("data:",e.value)&&F.push(e.value);break;case"Value":if(p(e))break;var T=this.declaration.property;if(q(e)&&de.push(n(e)),I("z-index",T))return p(e)||he.push(n(e)),this.skip;if(I("font",T)){if(b(e)||ve.push(function(e,t){var r="";return a.default(e,{reverse:!0,enter:function(e){if("String"===e.type){var n=e.loc.start,i=t({loc:{start:{line:n.line,column:n.column},end:{line:n.line,column:n.column+1}}});return r=i+e.value+i+r}return"Operator"===e.type&&44===e.value.charCodeAt(0)?r=e.value+r:"Identifier"===e.type?m[e.name]?this.skip:r=e.name+r:void 0}}),r}(e,n)),!w(e)){var A=function(e){var t,r=!1;return a.default(e,function(e){switch(e.type){case"Number":if(48===e.value.charCodeAt(0))return t="0",this.break;case"Operator":47===e.value.charCodeAt(0)&&(r=!0);break;case"Dimension":if(!r)return t=e.value+e.unit,this.break;case"Identifier":if(v[e.name])return t=e.name,this.break}}),t}(e);A&&ge.push(A)}break}if(I("font-size",T)){w(e)||ge.push(n(e));break}if(I("font-family",T)){b(e)||ve.push(n(e));break}if(I("transition",T)||I("animation",T)){for(var xe=function(e,t){var r=!1,n=[],i=[];return e.forEach(function(e){return"Operator"===e.type?r=!1:"Dimension"===e.type&&!1===r?(r=!0,n.push(t(e))):"Identifier"===e.type&&y[e.name]?i.push(t(e)):"Function"!==e.type||"cubic-bezier"!==e.name&&"steps"!==e.name?void 0:i.push(t(e))}),[n,i]}(e.children,n),qe=xe[0],Se=xe[1],ze=0;ze<qe.length;ze++)ke.push(qe[ze]);for(var Oe=0;Oe<Se.length;Oe++)we.push(Se[Oe]);break}if(I("animation-duration",T)||I("transition-duration",T)){ke.push(n(e));break}if(I("transition-timing-function",T)||I("animation-timing-function",T)){we.push(n(e));break}I("text-shadow",T)?p(e)||me.push(n(e)):I("box-shadow",T)&&(p(e)||be.push(n(e))),a.default(e,function(e){switch(e.type){case"Hash":return pe.push("#"+e.value,T),this.skip;case"Identifier":var t=e.name;return t.length>20||t.length<3||f[t.toLowerCase()]&&pe.push(n(e),T),this.skip;case"Function":if(function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!1===o(e.charCodeAt(r),t.charCodeAt(r)))return!1;return!0}("var",e.name))return this.skip;d[e.name.toLowerCase()]&&pe.push(n(e),T)}});break;case"Declaration":ae++;var De=n(e);ie.push(De),e.important&&(oe++,this.atrule&&s("keyframes",this.atrule.name)&&se++);var Ie=e.property;ue.push(Ie),x(Ie)?ce.push(Ie):function(e){if(D(e)||x(e))return!1;var t=e.charCodeAt(0);return 47===t||95===t||43===t||42===t||38===t||36===t||35===t}(Ie)?le.push(Ie):D(Ie)&&fe.push(Ie)}});var xe=F.count(),qe=Object.keys(xe.unique).join("").length,Se=ie.count(),ze=ee.size(),Oe=Y.aggregate(),De=Z.aggregate(),Ie=$.aggregate(),je=new S(ee.toArray()).count(),Ce=X.count(),Fe=Object.assign;return{stylesheet:{sourceLinesOfCode:R+ze+ae+W.size(),linesOfCode:r.length,size:e.length,comments:{total:k,size:C},embeddedContent:Fe(xe,{size:{total:qe,ratio:0===e.length?0:qe/e.length}})},atrules:{fontface:{total:U.length,totalUnique:U.length,unique:U,uniquenessRatio:0===U.length?0:1},import:B.count(),media:E.count(),charset:H.count(),supports:K.count(),keyframes:Fe(L.count(),{prefixed:Fe(M.count(),{ratio:0===L.size()?0:M.size()/L.size()})}),container:N.count(),layer:_.count()},rules:{total:V,empty:{total:G,ratio:0===V?0:G/V},selectors:Fe(J.aggregate(),{items:J.toArray()}),declarations:Fe(Q.aggregate(),{items:Q.toArray()})},selectors:{total:ze,totalUnique:Ce,uniquenessRatio:0===ze?0:Ce/ze,specificity:{min:void 0===g?[0,0,0]:g,max:void 0===h?[0,0,0]:h,sum:[Oe.sum,De.sum,Ie.sum],mean:[Oe.mean,De.mean,Ie.mean],mode:[Oe.mode,De.mode,Ie.mode],median:[Oe.median,De.median,Ie.median],items:te},complexity:Fe(ee.aggregate(),je,{items:ee.toArray()}),id:Fe(re.count(),{ratio:0===ze?0:re.size()/ze}),accessibility:Fe(ne.count(),{ratio:0===ze?0:ne.size()/ze}),keyframes:W.count()},declarations:{total:ae,unique:{total:Se,ratio:0===ae?0:Se/ae},importants:{total:oe,ratio:0===ae?0:oe/ae,inKeyframes:{total:se,ratio:0===oe?0:se/oe}}},properties:Fe(ue.count(),{prefixed:Fe(ce.count(),{ratio:0===ue.size()?0:ce.size()/ue.size()}),custom:Fe(fe.count(),{ratio:0===ue.size()?0:fe.size()/ue.size()}),browserhacks:Fe(le.count(),{ratio:0===ue.size()?0:le.size()/ue.size()})}),values:{colors:pe.count(),fontFamilies:ve.count(),fontSizes:ge.count(),zindexes:he.count(),textShadows:me.count(),boxShadows:be.count(),animations:{durations:ke.count(),timingFunctions:we.count()},prefixes:de.count(),units:ye.count()},__meta__:{parseTime:A-P,analyzeTime:new Date-A,total:new Date-t}}},e.compareSpecificity=l});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("css-tree/parser"),require("css-tree/walker")):"function"==typeof define&&define.amd?define(["exports","css-tree/parser","css-tree/walker"],t):t((e||self).cssAnalyzer={},e.parse,e.walk)}(this,function(e,t,r){function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=/*#__PURE__*/n(t),a=/*#__PURE__*/n(r);function o(e,t){return t>=65&&t<=90&&(t|=32),e===t}function s(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!1===o(e.charCodeAt(r),t.charCodeAt(r)))return!1;return!0}function u(e,t){var r=t.length-e.length;if(r<0)return!1;for(var n=t.length-1;n>=r;n--)if(!1===o(e.charCodeAt(n-r),t.charCodeAt(n)))return!1;return!0}function l(e,t){if(t.length<e.length)return!1;for(var r=0;r<e.length;r++)if(!1===o(e.charCodeAt(r),t.charCodeAt(r)))return!1;return!0}function c(e,t,r){return s(t,e.property)&&"Identifier"===e.value.children.first.type&&s(r,e.value.children.first.name)}function f(e){return 45===e.charCodeAt(0)&&45!==e.charCodeAt(1)&&-1!==e.indexOf("-",2)}function d(e,t){return e[0]===t[0]?e[1]===t[1]?t[2]-e[2]:t[1]-e[1]:t[0]-e[0]}var h=function(e){var t=0,r=0,n=0,i=0,o=!1;return a.default(e,function(e){switch(e.type){case"IdSelector":t++,i++;break;case"ClassSelector":r++,i++;break;case"AttributeSelector":r++,i++,Boolean(e.value)&&i++,(s("role",e.name.name)||l("aria-",e.name.name))&&(o=!0);break;case"PseudoElementSelector":case"TypeSelector":if(i++,f(e.name)&&i++,42===e.name.charCodeAt(0)&&1===e.name.length)break;n++;break;case"PseudoClassSelector":switch(e.name){case"before":case"after":case"first-letter":case"first-line":return n++,i++,this.skip;case"where":case"is":case"has":case"matches":case"-webkit-any":case"-moz-any":case"not":case"nth-child":case"nth-last-child":f(e.name)&&i++,"nth-child"!==e.name&&"nth-last-child"!==e.name||r++;var u=(v=[],a.default(e,{visit:"Selector",enter:function(e){v.push(h(e))}}),v.sort(function(e,t){return d([e[0],e[1],e[2]],[t[0],t[1],t[2]])}));if(0===u.length)return;if("where"!==e.name){var c=u[0];t+=c[0],r+=c[1],n+=c[2]}for(var m=0;m<u.length;m++){var b=u[m];1===b[4]&&(o=!0),i+=b[3]}return i++,this.skip;default:return i++,r++,this.skip}case"Combinator":i++}var v}),[t,r,n,i,o?1:0]},m={aliceblue:1,antiquewhite:1,aqua:1,aquamarine:1,azure:1,beige:1,bisque:1,black:1,blanchedalmond:1,blue:1,blueviolet:1,brown:1,burlywood:1,cadetblue:1,chartreuse:1,chocolate:1,coral:1,cornflowerblue:1,cornsilk:1,crimson:1,cyan:1,darkblue:1,darkcyan:1,darkgoldenrod:1,darkgray:1,darkgreen:1,darkgrey:1,darkkhaki:1,darkmagenta:1,darkolivegreen:1,darkorange:1,darkorchid:1,darkred:1,darksalmon:1,darkseagreen:1,darkslateblue:1,darkslategray:1,darkslategrey:1,darkturquoise:1,darkviolet:1,deeppink:1,deepskyblue:1,dimgray:1,dimgrey:1,dodgerblue:1,firebrick:1,floralwhite:1,forestgreen:1,fuchsia:1,gainsboro:1,ghostwhite:1,gold:1,goldenrod:1,gray:1,green:1,greenyellow:1,grey:1,honeydew:1,hotpink:1,indianred:1,indigo:1,ivory:1,khaki:1,lavender:1,lavenderblush:1,lawngreen:1,lemonchiffon:1,lightblue:1,lightcoral:1,lightcyan:1,lightgoldenrodyellow:1,lightgray:1,lightgreen:1,lightgrey:1,lightpink:1,lightsalmon:1,lightseagreen:1,lightskyblue:1,lightslategray:1,lightslategrey:1,lightsteelblue:1,lightyellow:1,lime:1,limegreen:1,linen:1,magenta:1,maroon:1,mediumaquamarine:1,mediumblue:1,mediumorchid:1,mediumpurple:1,mediumseagreen:1,mediumslateblue:1,mediumspringgreen:1,mediumturquoise:1,mediumvioletred:1,midnightblue:1,mintcream:1,mistyrose:1,moccasin:1,navajowhite:1,navy:1,oldlace:1,olive:1,olivedrab:1,orange:1,orangered:1,orchid:1,palegoldenrod:1,palegreen:1,paleturquoise:1,palevioletred:1,papayawhip:1,peachpuff:1,peru:1,pink:1,plum:1,powderblue:1,purple:1,rebeccapurple:1,red:1,rosybrown:1,royalblue:1,saddlebrown:1,salmon:1,sandybrown:1,seagreen:1,seashell:1,sienna:1,silver:1,skyblue:1,slateblue:1,slategray:1,slategrey:1,snow:1,springgreen:1,steelblue:1,tan:1,teal:1,thistle:1,tomato:1,turquoise:1,violet:1,wheat:1,white:1,whitesmoke:1,yellow:1,yellowgreen:1,canvas:1,canvastext:1,linktext:1,visitedtext:1,activetext:1,buttonface:1,buttontext:1,buttonborder:1,field:1,fieldtext:1,highlight:1,highlighttext:1,selecteditem:1,selecteditemtext:1,mark:1,marktext:1,graytext:1},b={rgb:1,rgba:1,hsl:1,hsla:1,hwb:1,lab:1,lch:1,oklab:1,oklch:1,color:1},v={inherit:1,initial:1,unset:1,revert:1,caption:1,icon:1,menu:1,"message-box":1,"small-caption":1,"status-bar":1},g={normal:1,"xx-small":1,"x-small":1,small:1,medium:1,large:1,"x-large":1,"xx-large":1,larger:1,smaller:1,bold:1,bolder:1,lighter:1,"ultra-condensed":1,"extra-condensed":1,condensed:1,"semi-condensed":1,"semi-expanded":1,expanded:1,"extra-expanded":1,"ultra-expanded":1,italic:1,oblique:1};function w(e){var t=e.children.first;return"Identifier"===t.type&&v[t.name]}var p={"xx-small":1,"x-small":1,small:1,medium:1,large:1,"x-large":1,"xx-large":1,larger:1,smaller:1},k={inherit:1,initial:1,unset:1,revert:1,caption:1,icon:1,menu:1,"message-box":1,"small-caption":1,"status-bar":1};function y(e){var t=e.children.first;return"Identifier"===t.type&&k[t.name]}var x={auto:1,inherit:1,initial:1,unset:1,revert:1,none:1};function q(e){if(!e.children)return!1;var t=e.children.first;return!!t&&!(e.children.size>1)&&"Identifier"===t.type&&x[t.name]}var z={linear:1,ease:1,"ease-in":1,"ease-out":1,"ease-in-out":1,"step-start":1,"step-end":1};function I(e){if(!e.children)return!1;for(var t=e.children.toArray(),r=0;r<t.length;r++){var n=t[r],i=n.type,a=n.name;if("Identifier"===i&&f(a))return!0;if("Function"===i){if(f(a))return!0;if(I(n))return!0}}return!1}var S=/*#__PURE__*/function(){function e(e){if(this.t={},this.i=0,this.o=0,e)for(var t=0;t<e.length;t++)this.push(e[t])}var t=e.prototype;return t.push=function(e){this.i++,this.t[e]?this.t[e]++:(this.t[e]=1,this.o++)},t.size=function(){return this.i},t.count=function(){return{total:this.i,totalUnique:this.o,unique:this.t,uniquenessRatio:0===this.i?0:this.o/this.i}},e}(),O=/*#__PURE__*/function(){function e(){this.u=new S,this.l={}}var t=e.prototype;return t.push=function(e,t){this.u.push(e),this.l[t]||(this.l[t]=new S),this.l[t].push(e)},t.count=function(){var e={};for(var t in this.l)e[t]=this.l[t].count();return Object.assign(this.u.count(),{itemsPerContext:e})},e}(),D=/*#__PURE__*/function(){function e(){this.t=[]}var t=e.prototype;return t.push=function(e){this.t.push(e)},t.size=function(){return this.t.length},t.aggregate=function(){if(0===this.t.length)return{min:0,max:0,mean:0,mode:0,median:0,range:0,sum:0};var e,t,r,n=this.t.slice().sort(function(e,t){return e-t}),i=n[0],a=n[n.length-1],o=this.t.reduce(function(e,t){return e+t}),s=function(e){for(var t=Object.create(null),r=-1,n=0,i=0,a=0;a<e.length;a++){var o=e[a],s=(t[o]||0)+1;t[o]=s,s>r&&(r=s,n=0,i=0),s>=r&&(n++,i+=o)}return i/n}(this.t),u=(t=(e=n).length/2)!==(r=Math.floor(t))?e[r]:(e[r]+e[r-1])/2;return{min:i,max:a,mean:o/this.t.length,mode:s,median:u,range:a-i,sum:o}},t.toArray=function(){return this.t},e}();function j(e){return!(e.length<3)&&45===e.charCodeAt(0)&&45===e.charCodeAt(1)}function C(e,t){return!j(t)&&u(e,t)}var R=/*#__PURE__*/function(){function e(){this.t=Object.create(null)}var t=e.prototype;return t.push=function(e){var t=function(e){for(var t=167,r=0;r<e.length;r++)t^=e.charCodeAt(r),t*=403;return t}(e);this.t[t]||(this.t[t]=1)},t.count=function(){return Object.keys(this.t).length},e}();function U(e,t){return 0===t?0:e/t}e.analyze=function(e){var t=Date.now(),r=e.split(/\r?\n/);function n(e){var t=e.loc.start,n=e.loc.end;if(0==n.line-t.line)return r[t.line-1].substring(t.column-1,n.column-1);for(var i="",a=t.line;a<=n.line;a++){var o=r[a-1];i+=a!==t.line?a!==n.line?o+"\n":o.substring(0,n.column-1):o.substring(t.column-1)+"\n"}return i}var o,v,k=0,x=0,F=new S,T=Date.now(),P=i.default(e,{parseCustomProperty:!0,positions:!0,onComment:function(e){k++,x+=e.length}}),_=Date.now(),M=0,A=[],B=new S,E=new S,H=new S,K=new S,L=new S,N=new S,Q=new S,V=new S,G=new S,J=new S,W=0,X=0,Y=new D,Z=new D,$=new D,ee=new S,te=new R,re=new D,ne=new D,ie=new D,ae=new S,oe=new D,se=[],ue=new S,le=new S,ce=new R,fe=0,de=0,he=0,me=new S,be=new S,ve=new S,ge=new S,we=new D,pe=new S,ke=new S,ye=new S,xe=new S,qe=new S,ze=new S,Ie=new S,Se=new S,Oe=new S,De=new O,je=new O;a.default(P,function(e){switch(e.type){case"Atrule":M++;var t=e.name;if("font-face"===t){var r={};e.block.children.forEach(function(e){return r[e.property]=n(e.value)}),A.push(r);break}if("media"===t){var i=n(e.prelude);H.push(i),function(e){var t=!1;return a.default(e,function(e){if("MediaQuery"===e.type&&1===e.children.size&&"Identifier"===e.children.first.type&&(l("\\0",(e=e.children.first).name)||u("\\9 ",e.name)))return t=!0,this.break;if("MediaFeature"===e.type){if(null!==e.value&&"\\0"===e.value.unit)return t=!0,this.break;if(s("-moz-images-in-menus",e.name)||s("min--moz-device-pixel-ratio",e.name)||s("-ms-high-contrast",e.name))return t=!0,this.break;if(s("min-resolution",e.name)&&s(".001",e.value.value)&&s("dpcm",e.value.unit))return t=!0,this.break;if(s("-webkit-min-device-pixel-ratio",e.name)&&(s("0",e.value.value)||s("10000",e.value.value)))return t=!0,this.break}}),t}(e.prelude)&&K.push(i);break}if("supports"===t){var k=n(e.prelude);N.push(k),function(e){var t=!1;return a.default(e,function(e){if("Declaration"===e.type&&(c(e,"-webkit-appearance","none")||c(e,"-moz-appearance","meterbar")))return t=!0,this.break}),t}(e.prelude)&&Q.push(k);break}if(u("keyframes",t)){var x="@"+t+" "+n(e.prelude);f(t)&&G.push(x),V.push(x);break}if("import"===t){E.push(n(e.prelude));break}if("charset"===t){L.push(n(e.prelude));break}if("container"===t){J.push(n(e.prelude));break}"layer"===t&&n(e.prelude).trim().split(",").forEach(function(e){return B.push(e.trim())});break;case"Rule":var S=e.prelude.children?e.prelude.children.size:0,O=e.block.children?e.block.children.size:0;Y.push(S+O),Z.push(S),$.push(O),W++,0===O&&X++;break;case"Selector":var D=n(e);if(this.atrule&&u("keyframes",this.atrule.name))return ee.push(D),this.skip;var R=h(e),U=R.splice(0,3),T=R[0],P=R[1];return U[0]>0&&ue.push(D),1===P&&le.push(D),te.push(D),oe.push(T),ae.push(U),void 0===o&&(o=U),void 0===v&&(v=U),re.push(U[0]),ne.push(U[1]),ie.push(U[2]),void 0!==v&&d(v,U)<0&&(v=U),void 0!==o&&d(o,U)>0&&(o=U),se.push(U),this.skip;case"Dimension":if(!this.declaration)break;return je.push(e.unit,this.declaration.property),this.skip;case"Url":l("data:",e.value)&&F.push(e.value);break;case"Value":if(q(e))break;var _=this.declaration,Ce=_.property,Re=_.important;if(I(e)&&pe.push(n(e)),"string"==typeof Re&&ke.push(n(e)+"!"+Re),e.children&&e.children.last&&"Identifier"===e.children.last.type&&u("\\9",e.children.last.name)&&ke.push(n(e)),C("z-index",Ce))return q(e)||ye.push(n(e)),this.skip;if(C("font",Ce)){if(w(e)||ze.push(function(e,t){var r="";return a.default(e,{reverse:!0,enter:function(e){if("String"===e.type){var n=e.loc.start,i=t({loc:{start:{line:n.line,column:n.column},end:{line:n.line,column:n.column+1}}});return r=i+e.value+i+r}return"Operator"===e.type&&44===e.value.charCodeAt(0)?r=e.value+r:"Identifier"===e.type?g[e.name]?this.skip:r=e.name+r:void 0}}),r}(e,n)),!y(e)){var Ue=function(e){var t,r=!1;return a.default(e,function(e){switch(e.type){case"Number":if(48===e.value.charCodeAt(0))return t="0",this.break;case"Operator":47===e.value.charCodeAt(0)&&(r=!0);break;case"Dimension":if(!r)return t=e.value+e.unit,this.break;case"Identifier":if(p[e.name])return t=e.name,this.break}}),t}(e);Ue&&Ie.push(Ue)}break}if(C("font-size",Ce)){y(e)||Ie.push(n(e));break}if(C("font-family",Ce)){w(e)||ze.push(n(e));break}if(C("transition",Ce)||C("animation",Ce)){for(var Fe=function(e,t){var r=!1,n=[],i=[];return e.forEach(function(e){return"Operator"===e.type?r=!1:"Dimension"===e.type&&!1===r?(r=!0,n.push(t(e))):"Identifier"===e.type&&z[e.name]?i.push(t(e)):"Function"!==e.type||"cubic-bezier"!==e.name&&"steps"!==e.name?void 0:i.push(t(e))}),[n,i]}(e.children,n),Te=Fe[0],Pe=Fe[1],_e=0;_e<Te.length;_e++)Oe.push(Te[_e]);for(var Me=0;Me<Pe.length;Me++)Se.push(Pe[Me]);break}if(C("animation-duration",Ce)||C("transition-duration",Ce)){Oe.push(n(e));break}if(C("transition-timing-function",Ce)||C("animation-timing-function",Ce)){Se.push(n(e));break}C("text-shadow",Ce)?q(e)||xe.push(n(e)):C("box-shadow",Ce)&&(q(e)||qe.push(n(e))),a.default(e,function(e){switch(e.type){case"Hash":return De.push("#"+e.value,Ce),this.skip;case"Identifier":var t=e.name;return t.length>20||t.length<3||m[t.toLowerCase()]&&De.push(n(e),Ce),this.skip;case"Function":if(s("var",e.name))return this.skip;b[e.name.toLowerCase()]&&De.push(n(e),Ce)}});break;case"Declaration":if(null!==this.atrulePrelude)return this.skip;fe++;var Ae=n(e);ce.push(Ae),!0===e.important&&(de++,this.atrule&&u("keyframes",this.atrule.name)&&he++);var Be=e.property;me.push(Be),f(Be)?(ve.push(Be),we.push(2)):function(e){if(j(e)||f(e))return!1;var t=e.charCodeAt(0);return 47===t||95===t||43===t||42===t||38===t||36===t||35===t}(Be)?(be.push(Be),we.push(2)):j(Be)?(ge.push(Be),we.push(2)):we.push(1)}});var Ce=F.count(),Re=Object.keys(Ce.unique).join("").length,Ue=ce.count(),Fe=oe.size(),Te=re.aggregate(),Pe=ne.aggregate(),_e=ie.aggregate(),Me=ae.count(),Ae=new S(oe.toArray()).count(),Be=te.count(),Ee=new S(Y.toArray()).count(),He=new S(Z.toArray()).count(),Ke=new S($.toArray()).count(),Le=Object.assign;return{stylesheet:{sourceLinesOfCode:M+Fe+fe+ee.size(),linesOfCode:r.length,size:e.length,comments:{total:k,size:x},embeddedContent:Le(Ce,{size:{total:Re,ratio:U(Re,e.length)}})},atrules:{fontface:{total:A.length,totalUnique:A.length,unique:A,uniquenessRatio:0===A.length?0:1},import:E.count(),media:Le(H.count(),{browserhacks:K.count()}),charset:L.count(),supports:Le(N.count(),{browserhacks:Q.count()}),keyframes:Le(V.count(),{prefixed:Le(G.count(),{ratio:U(G.size(),V.size())})}),container:J.count(),layer:B.count()},rules:{total:W,empty:{total:X,ratio:U(X,W)},sizes:Le(Y.aggregate(),{items:Y.toArray(),unique:Ee.unique,totalUnique:Ee.totalUnique,uniquenessRatio:Ee.uniquenessRatio}),selectors:Le(Z.aggregate(),{items:Z.toArray(),unique:He.unique,totalUnique:He.totalUnique,uniquenessRatio:He.uniquenessRatio}),declarations:Le($.aggregate(),{items:$.toArray(),unique:Ke.unique,totalUnique:Ke.totalUnique,uniquenessRatio:Ke.uniquenessRatio})},selectors:{total:Fe,totalUnique:Be,uniquenessRatio:U(Be,Fe),specificity:{min:void 0===v?[0,0,0]:v,max:void 0===o?[0,0,0]:o,sum:[Te.sum,Pe.sum,_e.sum],mean:[Te.mean,Pe.mean,_e.mean],mode:[Te.mode,Pe.mode,_e.mode],median:[Te.median,Pe.median,_e.median],items:se,unique:Me.unique,totalUnique:Me.totalUnique,uniquenessRatio:Me.uniquenessRatio},complexity:Le(oe.aggregate(),Ae,{items:oe.toArray()}),id:Le(ue.count(),{ratio:U(ue.size(),Fe)}),accessibility:Le(le.count(),{ratio:U(le.size(),Fe)}),keyframes:ee.count()},declarations:{total:fe,totalUnique:Ue,uniquenessRatio:U(Ue,fe),unique:{total:Ue,ratio:U(Ue,fe)},importants:{total:de,ratio:U(de,fe),inKeyframes:{total:he,ratio:U(he,de)}}},properties:Le(me.count(),{prefixed:Le(ve.count(),{ratio:U(ve.size(),me.size())}),custom:Le(ge.count(),{ratio:U(ge.size(),me.size())}),browserhacks:Le(be.count(),{ratio:U(be.size(),me.size())}),complexity:we.aggregate()}),values:{colors:De.count(),fontFamilies:ze.count(),fontSizes:Ie.count(),zindexes:ye.count(),textShadows:xe.count(),boxShadows:qe.count(),animations:{durations:Oe.count(),timingFunctions:Se.count()},prefixes:pe.count(),browserhacks:ke.count(),units:je.count()},__meta__:{parseTime:_-T,analyzeTime:Date.now()-_,total:Date.now()-t}}},e.compareSpecificity=d});
|
|
2
2
|
//# sourceMappingURL=analyzer.umd.js.map
|