"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseBooleanEnv = parseBooleanEnv;
exports.isRedisConfigured = isRedisConfigured;
const class_validator_1 = require("class-validator");
function parseBooleanEnv(key, defaultValue = false) {
    const value = process.env[key];
    if (value === undefined) {
        return defaultValue;
    }
    return value.toLowerCase() === 'true';
}
function isRedisConfigured(configService) {
    const host = configService.get('REDIS_HOST');
    const port = configService.get('REDIS_PORT');
    return host && port && (0, class_validator_1.isNumber)(parseInt(port));
}
//# sourceMappingURL=environment.helper.js.map