confinode
Version:
Node application configuration reader
27 lines • 868 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const ConfigDescription_1 = require("../ConfigDescription");
/**
* Description of an item for which parent value is overriden by children (and not merged).
*/
class OverrideDescription {
/**
* Create the override description.
*
* @param description - The description of the element to override.
*/
constructor(description) {
this.description = description;
}
parse(data, context) {
const { parent, ...inheritableContext } = context;
if (data === undefined && parent) {
return parent;
}
else {
return ConfigDescription_1.asDescription(this.description).parse(data, inheritableContext);
}
}
}
exports.default = OverrideDescription;
//# sourceMappingURL=OverrideDescription.js.map