Skip to content

Commit d2f5cbb

Browse files
committed
Add get method to ReadOnlyEnv
1 parent 3673750 commit d2f5cbb

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

lib/entry-points.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/environment.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,11 @@ export class ReadOnlyEnv<T extends string | undefined = string | undefined> {
270270
return Object.create(this, { vars: { value: { ...this.vars } } }) as this;
271271
}
272272

273+
/** Gets a copy of the underlying environment. */
274+
public get(): Record<string, T> {
275+
return { ...this.vars };
276+
}
277+
273278
/** Tries to get the value for `name` and throws if there isn't one. */
274279
public getRequired(name: string): string {
275280
return getRequiredEnvVar(this.vars, name);

0 commit comments

Comments
 (0)