Commit a8c3313e authored by nanahira's avatar nanahira

compat

parent 950956b7
import { SchemaClassOptions, SchemaOptions, SchemaProperty } from '../def';
import { RegisterSchema } from './register';
export const DefineSchema =
(
options: SchemaOptions | SchemaClassOptions = {},
): PropertyDecorator & ClassDecorator =>
(obj, key?) => {
if (key) {
return SchemaProperty(options)(obj, key);
} else {
return RegisterSchema(options)(obj);
}
};
export const SchemaConf = RegisterSchema;
import { ClassType, SchemaOptions } from '../def/interfaces';
import { ClassType, SchemaOptions } from '../def';
import { Metadata } from '../metadata/metadata';
import {
SetTransformer,
......@@ -52,6 +52,3 @@ export function SchemaProperty(options: SchemaOptions = {}): PropertyDecorator {
return Metadata.set('SchemaMeta', options, 'SchemaMetaKey')(obj, key);
};
}
// for backward compatibility
export const DefineSchema = SchemaProperty;
export * from './define-property';
export * from './register';
export * from './compat';
......@@ -177,6 +177,3 @@ export function RegisterSchema(options: SchemaClassOptions = {}) {
return SchemaClass(originalClass);
};
}
// for backward compatibility
export const SchemaConf = RegisterSchema;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment