Sha256: 301b4b27fc3fd8f1391c4f1815a314cd64d0b8023a83536cb76bbe3f0dfa744a
Contents?: true
Size: 1.22 KB
Versions: 10
Compression:
Stored size: 1.22 KB
Contents
const mongoose = require('mongoose/browser'); const Code = require('../basetypes/Code'); const Interval = require('../basetypes/Interval'); const Quantity = require('../basetypes/Quantity'); const DateTime = require('../basetypes/DateTime'); const QDMDate = require('../basetypes/QDMDate'); const Any = require('../basetypes/Any'); const [Schema] = [mongoose.Schema]; const [Number, String] = [ mongoose.Schema.Types.Number, mongoose.Schema.Types.String, ]; const ComponentSchema = new mongoose.Schema({ code: Code, result: Any, qdmVersion: { type: String, default: '5.5' }, _type: { type: String, default: 'QDM::Component' }, }); module.exports.ComponentSchema = ComponentSchema; class Component extends mongoose.Document { constructor(object) { super(object, ComponentSchema); this._type = 'QDM::Component'; } } function ComponentSchemaFunction(add, options) { const extended = new Schema({ code: Code, result: Any, qdmVersion: { type: String, default: '5.5' }, _type: { type: String, default: 'QDM::Component' }, }, options); if (add) { extended.add(add); } return extended; } module.exports.Component = Component; module.exports.ComponentSchemaFunction = ComponentSchemaFunction;
Version data entries
10 entries across 10 versions & 1 rubygems