ottoman
Version:
Ottoman Couchbase ODM
21 lines • 730 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.set = void 0;
const schema_1 = require("../schema");
const set = (key, value) => {
const valueType = typeof value;
if (typeof value === 'string' && key) {
process.env[key] = value;
}
else if ((valueType === 'boolean' || valueType === 'number') && key) {
process.env[key] = String(value);
}
else {
if (!key) {
throw new schema_1.ValidationError('set first argument required a valid string value');
}
throw new schema_1.ValidationError('set second argument must be number | string | boolean value');
}
};
exports.set = set;
//# sourceMappingURL=environment-set.js.map