@liplum/env
Version:
Reading and parsing environment variables from "process.env"
18 lines • 474 B
JavaScript
import { EnvMixin } from "./shared.js";
export class StringEnv extends EnvMixin {
getOrNull = () => {
const raw = this.env.getOrNull();
if (raw === undefined) {
return this.getDefaultValue();
}
return raw;
};
get = () => {
const result = this.getOrNull();
if (result === undefined) {
throw this.missingEnvError();
}
return result;
};
}
//# sourceMappingURL=string.js.map