Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/providers/googleicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

async function getFontDetails(family: string, options: ResolveFontOptions<GoogleiconsFamilyOptions>) {
// Google Icons require sorted icon names, or we will see a 400 error
const iconNames = (options.options?.experimental?.glyphs ?? providerOptions.experimental?.glyphs?.[family])?.join('')
const iconNames = (options.options?.experimental?.glyphs ?? providerOptions.experimental?.glyphs?.[family])?.slice().sort().join(',')

Check failure on line 48 in src/providers/googleicons.ts

View workflow job for this annotation

GitHub Actions / lint

Use options.options?.experimental?.glyphs ?? providerOptions.experimental?.glyphs?.[family].toSorted() instead of copying and sorting

let css = ''

Expand Down
12 changes: 6 additions & 6 deletions test/providers/googleicons.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('googleicons', () => {
const unifont = await createUnifont([providers.googleicons({
experimental: {
glyphs: {
'Material Symbols Outlined': ['arrow_right', 'favorite', 'arrow_drop_down'],
'Material Symbols Outlined': ['bar_chart', 'bolt'],
},
},
})])
Expand All @@ -78,8 +78,8 @@ describe('googleicons', () => {
{
"format": "woff2",
"identifier": {
"kit": "",
"skey": "",
"kit": "kJEhBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oFsLjBuVYLAPbrM4kWKE8mcwLO8rfPSFqKIVE",
"skey": "b8dc2088854b122f",
},
},
],
Expand All @@ -97,7 +97,7 @@ describe('googleicons', () => {
options: {
googleicons: {
experimental: {
glyphs: ['arrow_right', 'favorite', 'arrow_drop_down'],
glyphs: ['bar_chart', 'bolt'],
},
},
},
Expand All @@ -118,8 +118,8 @@ describe('googleicons', () => {
{
"format": "woff2",
"identifier": {
"kit": "",
"skey": "",
"kit": "kJEhBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oFsLjBuVYLAPbrM4kWKE8mcwLO8rfPSFqKIVE",
"skey": "b8dc2088854b122f",
},
},
],
Expand Down
Loading