Skip to content

Commit

Permalink
Eliminate Some as
Browse files Browse the repository at this point in the history
  • Loading branch information
graphemecluster committed Apr 10, 2024
1 parent 8d258bf commit c0e26ab
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/i18n/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export function getAllLocales(): string[] {
}

export function detectLocaleAliased(detector: LocaleDetector): Locales {
const locale = detectLocale<Locales>(baseLocale, getAllLocales() as Locales[], detector);
const locale = detectLocale(baseLocale, getAllLocales(), detector);
return getAliasedLocale(locale);
}
6 changes: 3 additions & 3 deletions src/lib/Output.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@
const x2 = (rectB1.left + rectB2.right) / 2 - rectOutput.left;
const y2 = rectB1.top - rectOutput.top - lineGap;
const color = colors[i];
lines.push([x1, y1 + straightLength, x2, y2 - straightLength, color] as Line);
lines.push([x1, y1 + straightLength, x2, y2 - straightLength, color]);
if (straightLength !== 0) {
lines.push([x1, y1, x1, y1 + straightLength, color] as Line);
lines.push([x2, y2, x2, y2 - straightLength, color] as Line);
lines.push([x1, y1, x1, y1 + straightLength, color]);
lines.push([x2, y2, x2, y2 - straightLength, color]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function* generateEvenlySpacedNumbers(start: number, end: number, n: number): Ge
type LCh = [l: number, c: number, h: number];

export function pickNColors(n: number): LCh[] {
return [...generateEvenlySpacedNumbers(0, 360, n)].map((degrees) => [0.6, 0.25, degrees]) as LCh[];
return [...generateEvenlySpacedNumbers(0, 360, n)].map((degrees) => [0.6, 0.25, degrees]);
}

export function lch2rgb(lch: LCh): string {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/lang.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const languageNames: Record<string, Intl.DisplayNames> = {};

const options = {
const options: Intl.DisplayNamesOptions = {
type: 'language'
} as Intl.DisplayNamesOptions;
};

export function getLanguageNames(locale: string): Intl.DisplayNames {
return languageNames[locale] ?? (languageNames[locale] = new Intl.DisplayNames([locale], options));
Expand Down

0 comments on commit c0e26ab

Please sign in to comment.