grapher/lib/exposure/extension.js

15 lines
354 B
JavaScript
Raw Normal View History

2016-09-14 16:04:08 +03:00
import Exposure from './exposure.js';
2018-03-29 19:04:43 +03:00
Object.assign(Mongo.Collection.prototype, {
2016-09-14 16:04:08 +03:00
expose(config) {
if (!Meteor.isServer) {
2018-03-29 19:04:43 +03:00
throw new Meteor.Error(
'not-allowed',
`You can only expose a collection server side. ${this._name}`
);
2016-09-14 16:04:08 +03:00
}
new Exposure(this, config);
2018-03-29 19:04:43 +03:00
},
});