UNPKG

octonom

Version:

Object Document Mapper for any database

53 lines 2.1 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; Object.defineProperty(exports, "__esModule", { value: true }); const main_1 = require("../../../lib/main"); class NestedModel extends main_1.Model { } __decorate([ main_1.Property.String() ], NestedModel.prototype, "id", void 0); __decorate([ main_1.Property.String() ], NestedModel.prototype, "name", void 0); exports.NestedModel = NestedModel; exports.nestedCollection = new main_1.ArrayCollection(NestedModel, { modelIdField: 'id' }); class AllModel extends main_1.Model { constructor(data) { super(data); } } __decorate([ main_1.Property.Any() ], AllModel.prototype, "any", void 0); __decorate([ main_1.Property.Array({ elementSchema: new main_1.Schema.Boolean() }) ], AllModel.prototype, "array", void 0); __decorate([ main_1.Property.Boolean() ], AllModel.prototype, "boolean", void 0); __decorate([ main_1.Property.Date() ], AllModel.prototype, "date", void 0); __decorate([ main_1.Property.Model({ model: NestedModel }) ], AllModel.prototype, "model", void 0); __decorate([ main_1.Property.Number() ], AllModel.prototype, "number", void 0); __decorate([ main_1.Property.Object({ schemaMap: { enabled: new main_1.Schema.Boolean() } }) ], AllModel.prototype, "object", void 0); __decorate([ main_1.Property.Reference({ collection: () => exports.nestedCollection }) ], AllModel.prototype, "reference", void 0); __decorate([ main_1.Property.String() ], AllModel.prototype, "string", void 0); exports.AllModel = AllModel; //# sourceMappingURL=all.js.map