Documentation - v1.6.0-beta.24
    Preparing search index...
    • Creates an environment variable parser that maps the variable keys to parsing functions.

      Type Parameters

      • K extends string

      Parameters

      • settings: ParserSettings<K> & ThisType<ParserSettings<K>>

        An object where each key is an environment variable name and the value is a function that takes the variable value as input and returns an object with optional key and value properties.

      Returns {
          parse(
              key: K,
              value: string,
          ): { key?: undefined; value?: undefined } | { key: string; value: any };
      }

      An object with a parse method that takes an environment variable key and value, and returns the parsed result.

      • parse: function
        • Parses the given environment variable key and value using the provided settings.

          Parameters

          • key: K

            The environment variable key.

          • value: string

            The environment variable value.

          Returns { key?: undefined; value?: undefined } | { key: string; value: any }

          The parsed result with optional renamed key and parsed value.

      The key property in the returned object can be used to rename the environment variable key, while the value property contains the parsed value.