Skip to content

Commit

Permalink
fix: typings for specifity metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart Veneman committed Oct 16, 2022
1 parent 2dc1b70 commit 070b1ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/context-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class ContextCollection {
}

count() {
/** @type {[index: string]: string} */
const itemsPerContext = {}

for (let context in this._contexts) {
Expand Down
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,11 +557,17 @@ const analyze = (css) => {
totalUnique: totalUniqueSelectors,
uniquenessRatio: ratio(totalUniqueSelectors, totalSelectors),
specificity: {
/** @type [number, number, number] */
min: minSpecificity === undefined ? [0, 0, 0] : minSpecificity,
/** @type [number, number, number] */
max: maxSpecificity === undefined ? [0, 0, 0] : maxSpecificity,
/** @type [number, number, number] */
sum: [specificitiesA.sum, specificitiesB.sum, specificitiesC.sum],
/** @type [number, number, number] */
mean: [specificitiesA.mean, specificitiesB.mean, specificitiesC.mean],
/** @type [number, number, number] */
mode: [specificitiesA.mode, specificitiesB.mode, specificitiesC.mode],
/** @type [number, number, number] */
median: [specificitiesA.median, specificitiesB.median, specificitiesC.median],
items: specificities,
unique: uniqueSpecificitiesCount.unique,
Expand Down

0 comments on commit 070b1ce

Please sign in to comment.