UNPKG

@mannguyen/nestcli

Version:

A CLI to create model

17 lines (12 loc) 387 B
import { upperFirst, camelCase } from "lodash"; import { Base } from "./base"; class OneToMany extends Base { getTemplate(options) { return ` @OneToMany('${upperFirst(camelCase(options.relationWith))}Entity') ${options.propertyName}: any[];`; } } export async function oneToManyTemplate(options) { const instance = new OneToMany(); return instance.execute(options); }