Merge remote-tracking branch 'origin/main' into mbg/refactor-util/errors

This commit is contained in:
Michael B. Gale
2026-10-30 16:50:30 +00:00
160 changed files with 18861 additions and 8747 deletions

View File

@@ -306,6 +306,20 @@ export class ReadOnlyEnv {
return { ...this.vars };
}
/** Gets a copy of the underlying environment, where the values are not `undefined`. */
public getDefined(): Record<string, string> {
const result: Record<string, string> = {};
for (const [key, val] of Object.entries(this.vars)) {
if (val === undefined) {
continue;
}
result[key] = val;
}
return result;
}
/** Tries to get the value for `name` and throws if there isn't one. */
public getRequired(name: string): string {
return getRequiredEnvVar(this.vars, name);