2
0
Fork 0
tcrud/lib/default/default-tentity.js

29 lines
693 B
JavaScript
Raw Permalink Normal View History

2017-06-10 14:53:29 +00:00
module.exports = (function () {
return function DefaultTEntityPlugin() {
this.configPlugin = function (ctx) {
ctx.key = 'defaultTEntity';
ctx.description = 'Adds the basic data and structure of the tentity.';
ctx.localDir = __dirname;
ctx.localConfigTemplate = 'default-tentity.json';
};
this.fillTEntity = function(ctx) {
if (ctx.tentity === undefined) {
throw new Error('no tentity');
}
if (ctx.tentity.tid === undefined) {
throw new Error('no tentity.tid');
}
if (ctx.tentity.tid === null) {
throw new Error('null tentity.tid');
}
if (ctx.tentity.tid.length === 0) {
throw new Error('empty tentity.tid');
}
};
};
})();