import { AstroError, AstroErrorData } from "../../core/errors/index.js";
import { validateEnvVariable } from "../../env/validators.js";
let _getEnv = () => {
  throw new AstroError(AstroErrorData.EnvUnsupportedGetSecret);
};
const defaultGetEnv = (key) => process.env[key];
function setGetEnv(fn) {
  _getEnv = fn;
}
function getEnv(...args) {
  return _getEnv(...args);
}
function createInvalidVariableError(...args) {
  return new AstroError({
    ...AstroErrorData.EnvInvalidVariable,
    message: AstroErrorData.EnvInvalidVariable.message(...args)
  });
}
export {
  createInvalidVariableError,
  defaultGetEnv,
  getEnv,
  setGetEnv,
  validateEnvVariable
};
