diff --git a/bundles/grid/helpers/grid.js b/bundles/grid/helpers/grid.ts similarity index 97% rename from bundles/grid/helpers/grid.js rename to bundles/grid/helpers/grid.ts index 25e14f8..907413f 100755 --- a/bundles/grid/helpers/grid.js +++ b/bundles/grid/helpers/grid.ts @@ -1,11 +1,11 @@ // Require local class dependencies -const xl = require('excel4node'); -const uuid = require('uuid'); -const Helper = require('helper'); -const moment = require('moment'); -const toText = require('html-to-text'); -const dotProp = require('dot-prop'); -const json2csv = require('json2csv'); +import xl from 'excel4node'; +import uuid from 'uuid'; +import Helper from 'helper'; +import moment from 'moment'; +import toText from 'html-to-text'; +import dotProp from 'dot-prop'; +import json2csv from 'json2csv'; // require models @@ -14,7 +14,7 @@ const Grid = model('grid'); /** * Create Grid Helper class */ -class GridHelper extends Helper { +export default class GridHelper extends Helper { /** * Construct Grid Helper class * @@ -148,7 +148,6 @@ class GridHelper extends Helper { ['where', 'match', 'eq', 'ne', 'or', 'and', 'elem', 'in', 'nin', 'gt', 'lt', 'gte', 'lte'].forEach((method) => { // Create new function this[method] = (...args) => { - // Set where // eslint-disable-next-line no-return-assign return this.__query = this.__query[method](...args); }; @@ -799,11 +798,4 @@ class GridHelper extends Helper { // returns true if object return (item && typeof item === 'object' && !Array.isArray(item)); } -} - -/** - * Export new Grid Helper instance - * - * @type {GridHelper} - */ -module.exports = GridHelper; +} \ No newline at end of file diff --git a/bundles/grid/models/grid.js b/bundles/grid/models/grid.ts similarity index 65% rename from bundles/grid/models/grid.js rename to bundles/grid/models/grid.ts index 6c26281..6265753 100755 --- a/bundles/grid/models/grid.js +++ b/bundles/grid/models/grid.ts @@ -1,11 +1,11 @@ // import dependencies -const Model = require('model'); +import Model from 'model'; /** * create user class */ -class Grid extends Model { +export default class Grid extends Model { /** * sanitises placement * @@ -17,10 +17,4 @@ class Grid extends Model { id : this.get('_id') ? this.get('_id').toString() : null, }; } -} - -/** - * export user class - * @type {user} - */ -module.exports = Grid; +} \ No newline at end of file diff --git a/bundles/grid/public/js/grid.js b/bundles/grid/public/js/grid.js index c8ce510..f1cd050 100755 --- a/bundles/grid/public/js/grid.js +++ b/bundles/grid/public/js/grid.js @@ -5,7 +5,7 @@ const Events = require('events'); const dotProp = require('dot-prop'); // Require live model -const EdenModel = require('model/public/js/model'); +const EdenModel = require('sync/public/js/model'); /** * create grid store