@necord/schematics
Version:
A collection of schematics for Necord projects with NestJS
27 lines (26 loc) • 902 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.component = component;
const common_1 = require("../common");
const component_type_enum_1 = require("./component-type.enum");
class ComponentSchematicFactory extends common_1.CommonSchematicFactory {
constructor() {
super(...arguments);
this.type = 'component';
}
generate(options) {
switch (options.strategy) {
case component_type_enum_1.ComponentType.Button:
this.templatePath = './files/button';
break;
case component_type_enum_1.ComponentType.Select:
this.templatePath = './files/select';
break;
}
return super.generate(options);
}
}
function component(options) {
const commandFactory = new ComponentSchematicFactory();
return commandFactory.create(options);
}