[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2026-04-25 22:34:53 +00:00
committed by GitHub
parent e05ae42fbb
commit d6919e340b
3 changed files with 5 additions and 17 deletions
+1 -8
View File
@@ -1,13 +1,6 @@
import { useMemo } from "react";
import {
fontList,
getFont,
getFontDisplayName,
getFontSearchKeywords,
localFontList,
webFontMap,
} from "@/utils/fonts";
import { fontList, getFont, getFontDisplayName, getFontSearchKeywords, localFontList, webFontMap } from "@/utils/fonts";
import { cn } from "@/utils/style";
import { Combobox, type MultiComboboxProps, type SingleComboboxProps } from "../ui/combobox";
+1 -7
View File
@@ -56,13 +56,7 @@ describe("buildResumeFontFamily", () => {
it("uses sans-oriented Chinese fallbacks for sans body fonts", () => {
const fonts = splitFontStack(buildResumeFontFamily("Inter"));
expect(fonts.slice(0, 5)).toEqual([
"Inter",
"Noto Sans SC",
"PingFang SC",
"Hiragino Sans GB",
"Microsoft YaHei",
]);
expect(fonts.slice(0, 5)).toEqual(["Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei"]);
expect(fonts.at(-1)).toBe("sans-serif");
});
});
+3 -2
View File
@@ -1,4 +1,5 @@
import type { LocalFont, WebFont } from "@/components/typography/types";
import webFontListJSON from "@/components/typography/webfontlist.json";
type FontCategory = LocalFont["category"];
@@ -172,8 +173,8 @@ export function getLoadableWebFontWeights(family: string, preferredWeights: stri
if (!font) return [];
const availableWeights = new Set<FontWeight>(font.weights);
const matchingWeights = unique(preferredWeights).filter(
(weight): weight is FontWeight => availableWeights.has(weight as FontWeight),
const matchingWeights = unique(preferredWeights).filter((weight): weight is FontWeight =>
availableWeights.has(weight as FontWeight),
);
if (matchingWeights.length > 0) return matchingWeights;