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

    Function validateEnvAgainstSources

    • Validate a composed env against every config layer's validation surface (#96): packaged, project public, and project local each contribute independently, instead of one layer shadowing the others.

      Behavior, per layer (lowest precedence first: packaged, project public, project local):

      • If the layer declares a JS/TS schema, run schema.safeParse(finalEnv) and collect its issues; every layer with a schema is checked (a project schema no longer shadows the packaged layer's schema).
      • Else if the layer declares requiredKeys, its keys join a union checked once against finalEnv after all layers are visited (base layer order first, de-duplicated).

      A config set that uses a single layer behaves exactly as before: that layer's own schema (if present) is checked in place of its own requiredKeys, matching the single-config precedent this validation always followed.

      Parameters

      • finalEnv: ProcessEnv

        Final composed environment to validate.

      • sources: ResolvedConfigSources

        Resolved config sources providing schema and/or requiredKeys.

      Returns string[]

      A list of human-readable issue strings (empty when valid).