Setu-TS
    Preparing search index...

    Function defineConfigSection

    • Declares a typed section over flat configuration keys.

      Every entry in keys is read as prefix + key; the schema receives those values under their prefix-stripped names. For example, prefix: 'DATABASE_' and keys: ['URL'] read DATABASE_URL and pass { URL } to the schema. The returned declaration is an immutable snapshot, so later mutations to the caller-owned definition cannot change a cached section.

      Type Parameters

      • T

        The validated output produced by schema

      Parameters

      • definition: ConfigSection<T>

        The flat-key prefix, declared keys, and schema

      Returns ConfigSection<T>

      A reusable section definition for ConfigPluginOptions.sections

      const database = defineConfigSection({
      prefix: 'DATABASE_',
      keys: ['URL'],
      schema: { parse: (input) => input },
      });

      0.7.0