web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

utils.ts (356B)


      1 import type { ThemeKey, ThemeMode } from "./types.js";
      2 
      3 export const parse_theme_mode = (value?: string | null): ThemeMode => {
      4     if (value === "dark") return "dark";
      5     return "light";
      6 };
      7 
      8 export const parse_theme_key = (value?: string | null): ThemeKey => {
      9     switch (value) {
     10         case "os": return value;
     11         default: return "os";
     12     }
     13 };