Skip to content

Commit 43bf157

Browse files
author
Bart Veneman
committed
fix double __unstable_uniqueWithLocations in fontfaces
1 parent 9c23fd8 commit 43bf157

File tree

4 files changed

+34
-46
lines changed

4 files changed

+34
-46
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@projectwallace/css-analyzer",
3-
"version": "5.12.2",
3+
"version": "5.13.0",
44
"author": "Bart Veneman",
55
"repository": {
66
"type": "git",

src/atrules/atrules.test.js

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -301,48 +301,36 @@ AtRules('finds @font-face', () => {
301301
useUnstableLocations: true
302302
}).atrules.fontface.__unstable_uniqueWithLocations
303303
const expected = {
304-
total: 5,
305-
totalUnique: 5,
306-
unique: {
307-
5: 1,
308-
100: 1,
309-
463: 1,
310-
590: 1,
311-
850: 1,
312-
},
313-
__unstable__uniqueWithLocations: {
314-
5: [{
315-
line: 2,
316-
column: 5,
317-
offset: 5,
318-
length: 89,
319-
}],
320-
100: [{
321-
line: 7,
322-
column: 5,
323-
offset: 100,
324-
length: 357,
325-
}],
326-
463: [{
327-
line: 20,
328-
column: 5,
329-
offset: 463,
330-
length: 121,
331-
}],
332-
590: [{
333-
line: 25,
334-
column: 5,
335-
offset: 590,
336-
length: 173,
337-
}],
338-
850: [{
339-
line: 33,
340-
column: 7,
341-
offset: 850,
342-
length: 127,
343-
}],
344-
},
345-
uniquenessRatio: 1
304+
5: [{
305+
line: 2,
306+
column: 5,
307+
offset: 5,
308+
length: 89,
309+
}],
310+
100: [{
311+
line: 7,
312+
column: 5,
313+
offset: 100,
314+
length: 357,
315+
}],
316+
463: [{
317+
line: 20,
318+
column: 5,
319+
offset: 463,
320+
length: 121,
321+
}],
322+
590: [{
323+
line: 25,
324+
column: 5,
325+
offset: 590,
326+
length: 173,
327+
}],
328+
850: [{
329+
line: 33,
330+
column: 7,
331+
offset: 850,
332+
length: 127,
333+
}],
346334
}
347335

348336
assert.equal(actual, expected)

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ export function analyze(css, options = {}) {
676676
unique: fontfaces,
677677
uniquenessRatio: fontFacesCount === 0 ? 0 : 1,
678678
}, useLocations ? {
679-
__unstable_uniqueWithLocations: fontfaces_with_loc.c(),
679+
__unstable_uniqueWithLocations: fontfaces_with_loc.c().__unstable__uniqueWithLocations,
680680
} : {}),
681681
import: imports.c(),
682682
media: assign(

0 commit comments

Comments
 (0)