GeoLeaf Core API - v3.19.0
    Preparing search index...

    Function resolveDefaultThemeId

    • Resolves the id of the theme a profile starts on.

      Parameters

      • themes: unknown

        A profile's themes block, as the profile or a themes.json carries it: { defaultTheme?, config?: { defautTheme? }, themes?: [{ id, … }] }. Anything else counts as a profile without themes.

      Returns string | null

      The declared default when it names a theme of the list (defaultTheme, then the legacy config.defautTheme); otherwise the first theme that has an id; null when the list holds no theme with an id.

      resolveDefaultThemeId({ themes: [{ id: "day" }, { id: "night" }] }); // "day"
      resolveDefaultThemeId({ defaultTheme: "night", themes: [{ id: "day" }, { id: "night" }] }); // "night"
      resolveDefaultThemeId({}); // null