import Foundation extension PHConfig { /// Return a copy with each `[env]` value expanded against `environment` /// (defaulting to the process environment). /// /// Unresolved references are left intact (see `PHEnvironment.expand`). func resolvingEnv(in environment: PHEnvironment = .process) -> PHConfig { guard let env, !env.isEmpty else { return self } return PHConfig( theme: theme, window: window, layout: layout, env: env.mapValues(environment.expand), monitors: monitors ) } }