diff --git a/package-lock.json b/package-lock.json index d21a359..e48eb3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@projectwallace/css-analyzer", - "version": "5.12.2", + "version": "5.13.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@projectwallace/css-analyzer", - "version": "5.12.2", + "version": "5.13.0", "license": "MIT", "dependencies": { "@bramus/specificity": "^2.3.0", diff --git a/package.json b/package.json index 948cb5c..0f6827e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@projectwallace/css-analyzer", - "version": "5.12.2", + "version": "5.13.0", "author": "Bart Veneman", "repository": { "type": "git", diff --git a/src/atrules/atrules.test.js b/src/atrules/atrules.test.js index f986d08..cd3f501 100644 --- a/src/atrules/atrules.test.js +++ b/src/atrules/atrules.test.js @@ -301,48 +301,36 @@ AtRules('finds @font-face', () => { useUnstableLocations: true }).atrules.fontface.__unstable_uniqueWithLocations const expected = { - total: 5, - totalUnique: 5, - unique: { - 5: 1, - 100: 1, - 463: 1, - 590: 1, - 850: 1, - }, - __unstable__uniqueWithLocations: { - 5: [{ - line: 2, - column: 5, - offset: 5, - length: 89, - }], - 100: [{ - line: 7, - column: 5, - offset: 100, - length: 357, - }], - 463: [{ - line: 20, - column: 5, - offset: 463, - length: 121, - }], - 590: [{ - line: 25, - column: 5, - offset: 590, - length: 173, - }], - 850: [{ - line: 33, - column: 7, - offset: 850, - length: 127, - }], - }, - uniquenessRatio: 1 + 5: [{ + line: 2, + column: 5, + offset: 5, + length: 89, + }], + 100: [{ + line: 7, + column: 5, + offset: 100, + length: 357, + }], + 463: [{ + line: 20, + column: 5, + offset: 463, + length: 121, + }], + 590: [{ + line: 25, + column: 5, + offset: 590, + length: 173, + }], + 850: [{ + line: 33, + column: 7, + offset: 850, + length: 127, + }], } assert.equal(actual, expected) diff --git a/src/index.js b/src/index.js index ffe3fdb..a125dc2 100644 --- a/src/index.js +++ b/src/index.js @@ -676,7 +676,7 @@ export function analyze(css, options = {}) { unique: fontfaces, uniquenessRatio: fontFacesCount === 0 ? 0 : 1, }, useLocations ? { - __unstable_uniqueWithLocations: fontfaces_with_loc.c(), + __unstable_uniqueWithLocations: fontfaces_with_loc.c().__unstable__uniqueWithLocations, } : {}), import: imports.c(), media: assign(