Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function Column(options: {
enum?: any, type?: cormo.types.ColumnType
| cormo.types.ColumnType[],
} & IColumnBasicOptions): PropertyDecorator {
let cormo_type: cormo.types.ColumnType | cormo.types.ColumnType[];
if (options.enum) {
cormo_type = cormo.types.Integer;
} else {
cormo_type = options.type!;
}
const c = cormo.Column({
_graphql: {
description: options.description,
},
default_value: options.default_value,
name: options.name,
required: options.required,
type: cormo_type,
unique: options.unique,
});
return (target: object, propertyKey: string | symbol) => {
c(target, propertyKey);
};
}