import env from "$env/index.js";

const parseBoolean = (value) => String(value).trim().toLowerCase() === "true";

const parseNationalCodes = (value = "") =>
  String(value)
    .split(",")
    .map((item) => item.trim())
    .filter(Boolean);

export default {
  environment: env.ENVIRONMENT,
  secret: env.SECRET,
  port: env.PORT,
  published: env.ENVIRONMENT === "production",
  frontBaseUrl: env.FRONT_BASE_URL,
  jwtExpiration: env.JWT_EXPIRATION,
  testMode: parseBoolean(env.TEST_MODE),
  testNationalCodes: parseNationalCodes(env.TEST_NATIONAL_CODES),
};
