@rawcmd/core
Version:
Rawcmd core package.
22 lines • 1.09 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class CommandOption {
constructor(recipe) {
recipe = Object.assign({}, recipe);
this.name = recipe.name || null;
this.alias = recipe.alias || null;
this.description = recipe.description || null;
this.setter = recipe.setter || null;
this.getter = recipe.getter || null;
this.parser = recipe.parser || null;
this.defaultValue = recipe.defaultValue || null;
this.emptyValue = recipe.emptyValue || null;
this.validators = [...(recipe.validators || [])];
this.handlers = [...(recipe.handlers || [])];
}
clone(recipe) {
return new this.constructor(Object.assign({ name: this.name, alias: this.alias, description: this.description, setter: this.setter, getter: this.getter, parser: this.parser, defaultValue: this.defaultValue, emptyValue: this.emptyValue, validators: this.validators, handlers: this.handlers }, recipe));
}
}
exports.CommandOption = CommandOption;
//# sourceMappingURL=command-option.js.map