UNPKG

@starrah/mongo-ts-struct

Version:

Mongoose wrapper for Typescript supports

22 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const handle_provided_type_1 = require("./handle-provided-type"); const create_property_decorator_1 = require("./create-property-decorator"); // export function DefineProperty(type: any, definition: any = {}) { // return (targetPrototype: Object, propertyName: string): void => { // const name = targetPrototype.constructor.name // if(!MetadataAgent.has(targetPrototype, `isProcessed:${name}`)) { // MetadataAgent.assign(targetPrototype, [`schemaDefinitions.${propertyName}`, { ...definition, type}]); // } // } // } function Property(type, definition = {}) { return create_property_decorator_1.createPropertyDecorator('Property', (targetPrototype, propertyName) => { return { type: handle_provided_type_1.handleProvidedType(type), definition }; }); } exports.Property = Property; //# sourceMappingURL=property.js.map