fix(utils): replace map with forEach to resolve biome lint error | 解决Github Action Biome 代码检查错误 (#601)
* fix(utils): replace map with forEach to resolve biome lint error * fix(utils): replace map with forEach in getCategoryList for clarity * fix(utils): specify radix parameter in Number.parseInt for clarity --------- Co-authored-by: L4Ph <me@l4ph.moe>
This commit is contained in:
@@ -10,12 +10,12 @@ import type { LIGHT_DARK_MODE } from "@/types/config";
|
||||
export function getDefaultHue(): number {
|
||||
const fallback = "250";
|
||||
const configCarrier = document.getElementById("config-carrier");
|
||||
return Number.parseInt(configCarrier?.dataset.hue || fallback);
|
||||
return Number.parseInt(configCarrier?.dataset.hue || fallback, 10);
|
||||
}
|
||||
|
||||
export function getHue(): number {
|
||||
const stored = localStorage.getItem("hue");
|
||||
return stored ? Number.parseInt(stored) : getDefaultHue();
|
||||
return stored ? Number.parseInt(stored, 10) : getDefaultHue();
|
||||
}
|
||||
|
||||
export function setHue(hue: number): void {
|
||||
|
||||
Reference in New Issue
Block a user