@@ -1,7 +1,7 @@
|
||||
import {
|
||||
BaseObject,
|
||||
Field,
|
||||
ObjectMetadata as Object,
|
||||
Object,
|
||||
FieldType,
|
||||
type FullNameField,
|
||||
type AddressField,
|
||||
|
||||
@@ -171,8 +171,10 @@ const collectObjects = (program: Program) => {
|
||||
const visit = (node: Node) => {
|
||||
if (isClassDeclaration(node) && getDecorators(node)?.length) {
|
||||
const decorators = getDecorators(node);
|
||||
const objectDec = decorators?.find((d) =>
|
||||
isDecoratorNamed(d, 'ObjectMetadata'),
|
||||
const objectDec = decorators?.find(
|
||||
(d) =>
|
||||
isDecoratorNamed(d, 'ObjectMetadata') ||
|
||||
isDecoratorNamed(d, 'Object'),
|
||||
);
|
||||
if (objectDec) {
|
||||
const cfg = getFirstArgObject(objectDec);
|
||||
@@ -184,8 +186,10 @@ const collectObjects = (program: Program) => {
|
||||
continue;
|
||||
}
|
||||
|
||||
const fieldDec = getDecorators(member)?.find((d) =>
|
||||
isDecoratorNamed(d, 'FieldMetadata'),
|
||||
const fieldDec = getDecorators(member)?.find(
|
||||
(d) =>
|
||||
isDecoratorNamed(d, 'FieldMetadata') ||
|
||||
isDecoratorNamed(d, 'Field'),
|
||||
);
|
||||
|
||||
if (!fieldDec) {
|
||||
|
||||
@@ -21,6 +21,6 @@ export {
|
||||
export { FieldType } from './field-metadata/field-type';
|
||||
export { Field } from './field-metadata/field.decorator';
|
||||
export { BaseObject } from './object-metadata/base-object';
|
||||
export { ObjectMetadata } from './object-metadata/object-metadata.decorator';
|
||||
export { Object } from './object-metadata/object.decorator';
|
||||
export type { ServerlessFunctionConfig } from './serverless-function-config';
|
||||
export type { SyncableEntityOptions } from './syncable-entity-options.type';
|
||||
|
||||
+1
-1
@@ -9,6 +9,6 @@ type ObjectMetadataOptions = SyncableEntityOptions & {
|
||||
icon?: string;
|
||||
};
|
||||
|
||||
export const ObjectMetadata = (_: ObjectMetadataOptions): ClassDecorator => {
|
||||
export const Object = (_: ObjectMetadataOptions): ClassDecorator => {
|
||||
return () => {};
|
||||
};
|
||||
Reference in New Issue
Block a user