@karmaniverous/get-dotenv
    Preparing search index...

    Function dotenvExpandAll

    • Recursively expands environment variables in the values of a JSON object. Variables may be presented with optional default as $VAR[:default] or ${VAR[:default]}. Unknown variables will expand to an empty string.

      Type Parameters

      • T extends
            | Record<string, string | undefined>
            | Readonly<Record<string, string | undefined>>

      Parameters

      Returns Record<string, string | undefined> & {
          [K in string | number | symbol]: string | undefined
      }

      The value object with expanded string values.

      process.env.FOO = 'bar';
      dotenvExpandAll({ A: '$FOO', B: 'x${FOO}y' });
      // => { A: "bar", B: "xbary" }

      Options:

      • ref: The reference object to use for expansion (defaults to process.env).
      • progressive: Whether to progressively add expanded values to the set of reference keys.

      When progressive is true, each expanded key becomes available for subsequent expansions in the same object (left-to-right by object key order).