mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-13 22:37:14 +10:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user