You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classPerson{
@label('First and last name')fullName: string;
@label('Date of birth')dob: Date;
@label('Number of children')
@min(0)numChildren: number;}schema=newSimpleSchema(Person);
And the resulting schema would be equivalent to:
schema=newSimpleSchema({fullName: {type: String,label: 'First and last name'},dob: {type: Date,label: 'Date of birth'},numChildren: {type: Number,label: "Number of children",min: 0}});
Is anyone looking into this? Should it be implemented as a separate package, or would a pull request which added support be considered (assuming it doesn't introduce any new dependencies).
The implementation I'm imagining would detect the existence of the Reflect.metadata API and, if it exists, use it to find the metadata and build the schema.
Thoughts?
The text was updated successfully, but these errors were encountered:
Typescript 1.5 adds support for decorators based on the ES7 decorators proposal, and it automatically adds type metadata to classes and properties. It would be nice if the resulting metadata could be used to create SimpleSchema objects. Ideally, I could write something like the following in Typescript:
And the resulting schema would be equivalent to:
Is anyone looking into this? Should it be implemented as a separate package, or would a pull request which added support be considered (assuming it doesn't introduce any new dependencies).
The implementation I'm imagining would detect the existence of the Reflect.metadata API and, if it exists, use it to find the metadata and build the schema.
Thoughts?
The text was updated successfully, but these errors were encountered: