Class: Config

Config()

Centralized application configuration class for non-user configurable settings. The Config class provides strongly-typed, centralized access to all core settings for API requests, locale, scoring, trending, and fediverse-wide data. It includes logic for environment-specific overrides (debug, quick load, load test), validation of config values, and locale/language management.

Constructor

new Config()

Construct a new Config instance, validate it, and logs the validated config.
Properties:
Name Type Description
api ApiConfig API request and caching configuration.
favouritedTags TagTootsConfig Settings for favourited tags and related toot fetching.
fediverse FediverseConfig Fediverse-wide server and trending configuration.
locale LocaleConfig Locale, language, and country settings.
participatedTags ParticipatedTagsConfig Settings for user's participated tags.
scoring ScoringConfig Scoring and weighting configuration for toots and tags.
toots TootsConfig Timeline and toot cache configuration.
trending TrendingConfig Trending data configuration for links, tags, and toots.
Implements:
  • ConfigType

Methods

minTrendingMinutesUntilStale() → {number}

Computes the minimum value of minutesUntilStale for all FEDIVERSE_CACHE_KEYS. Warns if any required keys are missing a value.
Returns:
The minimum minutes until trending data is considered stale, or 60 if not all keys are configured.
Type
number

setLocale(localeopt)

Sets the locale, language, and country for the application if supported. Falls back to defaults if the locale is invalid or unsupported.
Parameters:
Name Type Attributes Description
locale string <optional>
The locale string (e.g., "en-CA").