Core - v1.0.0
    Preparing search index...

    Function resolve

    • Resolves a module's configuration.

      The one way the rest of the system reads configuration. Callers get a settled object and never learn whether a value was defaulted or overridden.

      Merging is per field, not per module: an override naming only model keeps the default binding, so a partial override cannot blank the rest. A field set to undefined is ignored for the same reason — { model: undefined } means "no opinion", not "erase it".

      Type Parameters

      • S = unknown

        The settings shape the caller expects back.

      Parameters

      • module: string

        Name of the module to resolve.

      Returns S

      The module's settings, with any override applied over the default.

      The surface is registered by the application, through configure. Keeping that edge in one place is what lets business logic stay unaware of where settings come from.

      The type argument is explicit because this package cannot know the assembled surface. The caller declares the shape it expects; the application is responsible for having registered something that matches.

      const settings = resolve<CacheSettings>('cache')
      // { ttl: 300 }

      ConfigurationError When the module is registered in neither the defaults nor the overrides — almost always because configure() has not run yet, or because a second copy of this package is loaded.

      Bayu Dwiyan Satria

      1.0.0

      1.0.0