mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
Refactor moment to be loaded from ctx (#7331)
* Experimental branch that replaces momentjs with dayjs in the client * Revert unintentional change * feat * Turns out dayjs is a no-go, but this has some good restructuring so submitting that
This commit is contained in:
@@ -18,14 +18,20 @@ require('../node_modules/flot/jquery.flot.time');
|
||||
require('../node_modules/flot/jquery.flot.pie');
|
||||
require('../node_modules/flot/jquery.flot.fillbetween');
|
||||
|
||||
window.moment = require('moment-timezone');
|
||||
const moment = require('moment-timezone');
|
||||
|
||||
window.moment = moment;
|
||||
|
||||
window.Nightscout = window.Nightscout || {};
|
||||
|
||||
var ctx = {
|
||||
moment: moment
|
||||
};
|
||||
|
||||
window.Nightscout = {
|
||||
client: require('../lib/client'),
|
||||
units: require('../lib/units')(),
|
||||
admin_plugins: require('../lib/admin_plugins/')()
|
||||
admin_plugins: require('../lib/admin_plugins/')(ctx)
|
||||
};
|
||||
|
||||
window.Nightscout.report_plugins_preinit = require('../lib/report_plugins/');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var moment = require('moment');
|
||||
var moment;
|
||||
|
||||
var cleanentriesdb = {
|
||||
name: 'cleanentriesdb'
|
||||
@@ -8,7 +8,8 @@ var cleanentriesdb = {
|
||||
, pluginType: 'admin'
|
||||
};
|
||||
|
||||
function init() {
|
||||
function init(ctx) {
|
||||
moment = ctx.moment;
|
||||
return cleanentriesdb;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var moment = require('moment');
|
||||
var moment;
|
||||
|
||||
var cleanstatusdb = {
|
||||
name: 'cleanstatusdb'
|
||||
@@ -8,7 +8,8 @@ var cleanstatusdb = {
|
||||
, pluginType: 'admin'
|
||||
};
|
||||
|
||||
function init () {
|
||||
function init (ctx) {
|
||||
moment = ctx.moment;
|
||||
return cleanstatusdb;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var moment = require('moment');
|
||||
var moment;
|
||||
|
||||
var cleantreatmentsdb = {
|
||||
name: 'cleantreatmentsdb'
|
||||
@@ -8,7 +8,8 @@ var cleantreatmentsdb = {
|
||||
, pluginType: 'admin'
|
||||
};
|
||||
|
||||
function init() {
|
||||
function init(ctx) {
|
||||
moment = ctx.moment;
|
||||
return cleantreatmentsdb;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
var _find = require('lodash/find');
|
||||
var _each = require('lodash/each');
|
||||
|
||||
function init() {
|
||||
function init(ctx) {
|
||||
var allPlugins = [
|
||||
require('./subjects')()
|
||||
, require('./roles')()
|
||||
, require('./cleanstatusdb')()
|
||||
, require('./cleantreatmentsdb')()
|
||||
, require('./cleanentriesdb')()
|
||||
, require('./futureitems')()
|
||||
require('./subjects')(ctx)
|
||||
, require('./roles')(ctx)
|
||||
, require('./cleanstatusdb')(ctx)
|
||||
, require('./cleantreatmentsdb')(ctx)
|
||||
, require('./cleanentriesdb')(ctx)
|
||||
, require('./futureitems')(ctx)
|
||||
];
|
||||
|
||||
function plugins(name) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment-timezone');
|
||||
var times = require('../times');
|
||||
var Storages = require('js-storage');
|
||||
|
||||
@@ -46,9 +45,9 @@ function init (client, $) {
|
||||
}
|
||||
|
||||
function setDateAndTime (time) {
|
||||
time = time || moment();
|
||||
eventTime.val(time.format('HH:mm'));
|
||||
eventDate.val(time.format('YYYY-MM-DD'));
|
||||
time = time || new Date();
|
||||
eventTime.val(time.getHours() + ":" + time.getMinutes());
|
||||
eventDate.val(time.toISOString().split('T')[0]);
|
||||
}
|
||||
|
||||
function mergeDateAndTime () {
|
||||
@@ -125,16 +124,15 @@ function init (client, $) {
|
||||
|
||||
boluscalc.calculateInsulin();
|
||||
maybePrevent(event);
|
||||
// Nightscout.utils.updateBrushToTime(moment.toDate());
|
||||
};
|
||||
|
||||
boluscalc.eventTimeTypeChange = function eventTimeTypeChange (event) {
|
||||
if ($('#bc_othertime').is(':checked')) {
|
||||
$('#bc_eventTimeValue').focus();
|
||||
$('#bc_retro').css('display', '');
|
||||
if (mergeDateAndTime() < moment()) {
|
||||
if (mergeDateAndTime() < Date.now()) {
|
||||
$('#bc_retro').css('background-color', 'red').text(translate('RETRO MODE'));
|
||||
} else if (mergeDateAndTime() > moment()) {
|
||||
} else if (mergeDateAndTime() > Date.now()) {
|
||||
$('#bc_retro').css('background-color', 'blue').text(translate('IN THE FUTURE'));
|
||||
} else {
|
||||
$('#bc_retro').css('display', 'none');
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
var moment = require('moment-timezone');
|
||||
var _ = require('lodash');
|
||||
var parse_duration = require('parse-duration'); // https://www.npmjs.com/package/parse-duration
|
||||
var times = require('../times');
|
||||
@@ -18,9 +17,9 @@ function init (client, $) {
|
||||
var eventDate = $('#eventDateValue');
|
||||
|
||||
function setDateAndTime (time) {
|
||||
time = time || moment();
|
||||
eventTime.val(time.format('HH:mm'));
|
||||
eventDate.val(time.format('YYYY-MM-DD'));
|
||||
time = time || client.ctx.moment();
|
||||
eventTime.val(time.hours() + ":" + time.minutes());
|
||||
eventDate.val(time.toISOString().split('T')[0]);
|
||||
}
|
||||
|
||||
function mergeDateAndTime () {
|
||||
|
||||
+8
-1
@@ -9,7 +9,6 @@ var Storages = require('js-storage');
|
||||
|
||||
var language = require('../language')();
|
||||
var sandbox = require('../sandbox')();
|
||||
var profile = require('../profilefunctions')();
|
||||
var units = require('../units')();
|
||||
var levels = require('../levels');
|
||||
var times = require('../times');
|
||||
@@ -18,6 +17,8 @@ var receiveDData = require('./receiveddata');
|
||||
var brushing = false;
|
||||
|
||||
var browserSettings;
|
||||
var moment = window.moment;
|
||||
var timezones = moment.tz.names();
|
||||
|
||||
var client = {};
|
||||
|
||||
@@ -203,6 +204,7 @@ client.load = function load (serverSettings, callback) {
|
||||
, extendedSettings: client.settings.extendedSettings
|
||||
, language: language
|
||||
, levels: levels
|
||||
, moment: moment
|
||||
}).registerClientDefaults();
|
||||
|
||||
browserSettings.loadPluginSettings(client);
|
||||
@@ -210,6 +212,7 @@ client.load = function load (serverSettings, callback) {
|
||||
client.utils = require('../utils')({
|
||||
settings: client.settings
|
||||
, language: language
|
||||
, moment: moment
|
||||
});
|
||||
|
||||
client.rawbg = client.plugins('rawbg');
|
||||
@@ -223,6 +226,8 @@ client.load = function load (serverSettings, callback) {
|
||||
, bus: require('../bus')(client.settings, client.ctx)
|
||||
, settings: client.settings
|
||||
, pluginBase: client.plugins.base(majorPills, minorPills, statusPills, bgStatus, client.tooltip, Storages.localStorage)
|
||||
, moment: moment
|
||||
, timezones: timezones
|
||||
};
|
||||
|
||||
client.ctx.language = language;
|
||||
@@ -298,6 +303,8 @@ client.load = function load (serverSettings, callback) {
|
||||
client.careportal = require('./careportal')(client, $);
|
||||
client.boluscalc = require('./boluscalc')(client, $);
|
||||
|
||||
var profile = require('../profilefunctions')(null, client.ctx);
|
||||
|
||||
client.profilefunctions = profile;
|
||||
|
||||
client.editMode = false;
|
||||
|
||||
@@ -139,7 +139,6 @@ function init(env, ctx) {
|
||||
});
|
||||
|
||||
console.info('Load Complete:\n\t', counts.join(', '));
|
||||
|
||||
done(err, result);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,6 @@
|
||||
|
||||
var _ = require('lodash');
|
||||
var times = require('../times');
|
||||
var moment = require('moment');
|
||||
|
||||
var BG_REF = 140; //Central tendency
|
||||
var BG_MIN = 36; //Not 39, but why?
|
||||
@@ -17,6 +16,7 @@ var AR2_COLOR = 'cyan';
|
||||
|
||||
function init (ctx) {
|
||||
var translate = ctx.language.translate;
|
||||
var moment = ctx.moment;
|
||||
|
||||
var ar2 = {
|
||||
name: 'ar2'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
'use strict';
|
||||
var times = require('../times');
|
||||
var moment = require('moment');
|
||||
var consts = require('../constants');
|
||||
var _ = require('lodash');
|
||||
|
||||
function init (ctx) {
|
||||
var moment = ctx.moment;
|
||||
|
||||
var translate = ctx.language.translate;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment');
|
||||
|
||||
function init(ctx) {
|
||||
var moment = ctx.moment;
|
||||
var translate = ctx.language.translate;
|
||||
var levels = ctx.levels;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment');
|
||||
var times = require('../times');
|
||||
|
||||
var offset = times.mins(2.5).msecs;
|
||||
@@ -9,6 +8,7 @@ var bucketFields = ['index', 'fromMills', 'toMills'];
|
||||
|
||||
function init (ctx) {
|
||||
|
||||
var moment = ctx.moment;
|
||||
var translate = ctx.language.translate;
|
||||
var utils = require('../utils')(ctx);
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment');
|
||||
|
||||
function init(ctx) {
|
||||
var moment = ctx.moment;
|
||||
var translate = ctx.language.translate;
|
||||
var levels = ctx.levels;
|
||||
|
||||
|
||||
+1
-1
@@ -1,10 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash')
|
||||
, moment = require('moment')
|
||||
, times = require('../times');
|
||||
|
||||
function init (ctx) {
|
||||
var moment = ctx.moment;
|
||||
var translate = ctx.language.translate;
|
||||
var iob = require('./iob')(ctx);
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment');
|
||||
|
||||
function init(ctx) {
|
||||
var moment = ctx.moment;
|
||||
var translate = ctx.language.translate;
|
||||
var levels = ctx.levels;
|
||||
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash')
|
||||
, moment = require('moment')
|
||||
, times = require('../times');
|
||||
const _ = require('lodash')
|
||||
const times = require('../times');
|
||||
|
||||
function init(ctx) {
|
||||
var moment = ctx.moment;
|
||||
var translate = ctx.language.translate;
|
||||
var utils = require('../utils')(ctx);
|
||||
|
||||
|
||||
+2
-1
@@ -1,12 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment');
|
||||
var times = require('../times');
|
||||
|
||||
// var ALL_STATUS_FIELDS = ['status-symbol', 'status-label', 'iob', 'freq', 'rssi']; Unused variable
|
||||
|
||||
function init (ctx) {
|
||||
var moment = ctx.moment;
|
||||
|
||||
var utils = require('../utils')(ctx);
|
||||
var translate = ctx.language.translate;
|
||||
var levels = ctx.levels;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment');
|
||||
var times = require('../times');
|
||||
var consts = require('../constants');
|
||||
|
||||
// var ALL_STATUS_FIELDS = ['status-symbol', 'status-label', 'iob', 'meal-assist', 'freq', 'rssi']; Unused variable
|
||||
|
||||
function init (ctx) {
|
||||
var moment = ctx.moment;
|
||||
var utils = require('../utils')(ctx);
|
||||
var openaps = {
|
||||
name: 'openaps'
|
||||
|
||||
+1
-1
@@ -1,12 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment');
|
||||
var times = require('../times');
|
||||
|
||||
var ALL_STATUS_FIELDS = ['reservoir', 'battery', 'clock', 'status', 'device'];
|
||||
|
||||
function init (ctx) {
|
||||
var moment = ctx.moment;
|
||||
var translate = ctx.language.translate;
|
||||
var timeago = require('./timeago')(ctx);
|
||||
var openaps = require('./openaps')(ctx);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment');
|
||||
var times = require('../times');
|
||||
|
||||
function init(ctx) {
|
||||
var moment = ctx.moment;
|
||||
var translate = ctx.language.translate;
|
||||
var levels = ctx.levels;
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var moment = require('moment');
|
||||
var _each = require('lodash/each');
|
||||
|
||||
function init(env, ctx) {
|
||||
var moment = ctx.moment;
|
||||
|
||||
function virtAsstBase() {
|
||||
return virtAsstBase;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment');
|
||||
var times = require('../times');
|
||||
|
||||
function init(ctx) {
|
||||
var moment = ctx.moment;
|
||||
var levels = ctx.levels;
|
||||
var utils = require('../utils')(ctx);
|
||||
var firstPrefs = true;
|
||||
|
||||
@@ -4,7 +4,6 @@ var init = function init () {
|
||||
//for the tests window isn't the global object
|
||||
var $ = window.$;
|
||||
var _ = window._;
|
||||
var moment = window.moment;
|
||||
var Nightscout = window.Nightscout;
|
||||
var client = Nightscout.client;
|
||||
|
||||
@@ -157,7 +156,7 @@ var init = function init () {
|
||||
|
||||
// Load timezones
|
||||
timezoneInput.empty();
|
||||
moment.tz.names().forEach(function addTz(tz) {
|
||||
client.ctx.timezones.forEach(function addTz(tz) {
|
||||
timezoneInput.append('<option value="' + tz + '">' + tz + '</option>');
|
||||
});
|
||||
|
||||
@@ -198,8 +197,8 @@ var init = function init () {
|
||||
}
|
||||
databaseRecords.val(currentrecord);
|
||||
|
||||
timeInput.val(moment(mongorecords[currentrecord].startDate).format('HH:mm'));
|
||||
dateInput.val(moment(mongorecords[currentrecord].startDate).format('YYYY-MM-DD'));
|
||||
timeInput.val(client.ctx.moment(mongorecords[currentrecord].startDate).format('HH:mm'));
|
||||
dateInput.val(client.ctx.moment(mongorecords[currentrecord].startDate).format('YYYY-MM-DD'));
|
||||
|
||||
initProfile();
|
||||
}
|
||||
@@ -635,11 +634,11 @@ var init = function init () {
|
||||
}
|
||||
|
||||
function toTimeString(minfrommidnight) {
|
||||
return moment.utc().startOf('day').add(minfrommidnight,'minutes').format('HH:mm'); // using utc to avoid daylight saving offset
|
||||
return client.ctx.moment.utc().startOf('day').add(minfrommidnight,'minutes').format('HH:mm'); // using utc to avoid daylight saving offset
|
||||
}
|
||||
|
||||
function toDisplayTime (minfrommidnight) {
|
||||
var time = moment.utc().startOf('day').add(minfrommidnight,'minutes'); // using utc to avoid daylight saving offset
|
||||
var time = client.ctx.moment.utc().startOf('day').add(minfrommidnight,'minutes'); // using utc to avoid daylight saving offset
|
||||
return client.settings.timeFormat === 24 ? time.format('HH:mm') : time.format('h:mm A');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment-timezone');
|
||||
var c = require('memory-cache');
|
||||
var times = require('./times');
|
||||
|
||||
var cacheTTL = 5000;
|
||||
var prevBasalTreatment = null;
|
||||
|
||||
function init (profileData) {
|
||||
function init (profileData, ctx) {
|
||||
|
||||
var moment = ctx.moment;
|
||||
|
||||
var cache = new c.Cache();
|
||||
var profile = {};
|
||||
|
||||
@@ -4,7 +4,6 @@ var init = function init () {
|
||||
//for the tests window isn't the global object
|
||||
var $ = window.$;
|
||||
var _ = window._;
|
||||
var moment = window.moment;
|
||||
var Nightscout = window.Nightscout;
|
||||
var client = Nightscout.client;
|
||||
var report_plugins_preinit = Nightscout.report_plugins_preinit;
|
||||
@@ -12,6 +11,8 @@ var init = function init () {
|
||||
|
||||
client.init(function loaded () {
|
||||
|
||||
var moment = client.ctx.moment;
|
||||
|
||||
report_plugins = report_plugins_preinit(client.ctx);
|
||||
Nightscout.report_plugins = report_plugins;
|
||||
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ function init () {
|
||||
sbx.language = ctx.language;
|
||||
sbx.translate = ctx.language.translate;
|
||||
|
||||
var profile = require('./profilefunctions')();
|
||||
var profile = require('./profilefunctions')(null, ctx);
|
||||
//Plugins will expect the right profile based on time
|
||||
profile.loadData(_.cloneDeep(ctx.ddata.profiles));
|
||||
profile.updateTreatments(ctx.ddata.profileTreatments, ctx.ddata.tempbasalTreatments, ctx.ddata.combobolusTreatments);
|
||||
|
||||
@@ -9,6 +9,7 @@ function boot (env, language) {
|
||||
|
||||
console.log('Executing startBoot');
|
||||
|
||||
ctx.moment = require('moment-timezone');
|
||||
ctx.runtimeState = 'booting';
|
||||
ctx.settings = env.settings;
|
||||
ctx.bus = require('../bus')(env.settings, ctx);
|
||||
@@ -211,6 +212,7 @@ function boot (env, language) {
|
||||
settings: env.settings
|
||||
, language: ctx.language
|
||||
, levels: ctx.levels
|
||||
, moment: ctx.moment
|
||||
}).registerServerDefaults();
|
||||
|
||||
ctx.wares = require('../middleware/')(env);
|
||||
|
||||
+1
-2
@@ -1,12 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment-timezone');
|
||||
|
||||
var units = require('./units')();
|
||||
|
||||
function init(ctx) {
|
||||
|
||||
var moment = ctx.moment;
|
||||
var settings = ctx.settings;
|
||||
var translate = ctx.language.translate;
|
||||
var timeago = require('./plugins/timeago')(ctx);
|
||||
|
||||
+9
-14
@@ -1,21 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
const should = require('should');
|
||||
const levels = require('../lib/levels');
|
||||
const fs = require('fs');
|
||||
const helper = require('./inithelper')();
|
||||
|
||||
const FIVE_MINS = 300000;
|
||||
const SIX_MINS = 360000;
|
||||
|
||||
describe('ar2', function ( ) {
|
||||
var ctx = {
|
||||
settings: {}
|
||||
, language: require('../lib/language')(fs)
|
||||
, levels: levels
|
||||
};
|
||||
var ctx = helper.getctx();
|
||||
|
||||
ctx.ddata = require('../lib/data/ddata')();
|
||||
ctx.notifications = require('../lib/notifications')(env, ctx);
|
||||
ctx.levels = levels;
|
||||
|
||||
var ar2 = require('../lib/plugins/ar2')(ctx);
|
||||
var bgnow = require('../lib/plugins/bgnow')(ctx);
|
||||
@@ -75,7 +70,7 @@ describe('ar2', function ( ) {
|
||||
});
|
||||
ar2.checkNotifications(sbx);
|
||||
var highest = ctx.notifications.findHighestAlarm();
|
||||
highest.level.should.equal(levels.WARN);
|
||||
highest.level.should.equal(helper.ctx.levels.WARN);
|
||||
highest.title.should.equal('Warning, HIGH predicted');
|
||||
highest.message.should.equal('BG Now: 170 +20 ↗ mg/dl\nBG 15m: 206 mg/dl\nIOB: 1.25U');
|
||||
|
||||
@@ -89,7 +84,7 @@ describe('ar2', function ( ) {
|
||||
var sbx = prepareSandbox();
|
||||
ar2.checkNotifications(sbx);
|
||||
var highest = ctx.notifications.findHighestAlarm();
|
||||
highest.level.should.equal(levels.URGENT);
|
||||
highest.level.should.equal(helper.ctx.levels.URGENT);
|
||||
highest.title.should.equal('Urgent, HIGH');
|
||||
|
||||
done();
|
||||
@@ -102,7 +97,7 @@ describe('ar2', function ( ) {
|
||||
var sbx = prepareSandbox();
|
||||
ar2.checkNotifications(sbx);
|
||||
var highest = ctx.notifications.findHighestAlarm();
|
||||
highest.level.should.equal(levels.WARN);
|
||||
highest.level.should.equal(helper.ctx.levels.WARN);
|
||||
highest.title.should.equal('Warning, LOW');
|
||||
|
||||
done();
|
||||
@@ -115,7 +110,7 @@ describe('ar2', function ( ) {
|
||||
var sbx = prepareSandbox();
|
||||
ar2.checkNotifications(sbx);
|
||||
var highest = ctx.notifications.findHighestAlarm();
|
||||
highest.level.should.equal(levels.WARN);
|
||||
highest.level.should.equal(helper.ctx.levels.WARN);
|
||||
highest.title.should.equal('Warning, LOW predicted');
|
||||
|
||||
done();
|
||||
@@ -128,7 +123,7 @@ describe('ar2', function ( ) {
|
||||
var sbx = prepareSandbox();
|
||||
ar2.checkNotifications(sbx);
|
||||
var highest = ctx.notifications.findHighestAlarm();
|
||||
highest.level.should.equal(levels.URGENT);
|
||||
highest.level.should.equal(helper.ctx.levels.URGENT);
|
||||
highest.title.should.equal('Urgent, LOW predicted');
|
||||
|
||||
done();
|
||||
@@ -143,7 +138,7 @@ describe('ar2', function ( ) {
|
||||
var sbx = prepareSandbox();
|
||||
ar2.checkNotifications(sbx);
|
||||
var highest = ctx.notifications.findHighestAlarm();
|
||||
highest.level.should.equal(levels.WARN);
|
||||
highest.level.should.equal(helper.ctx.levels.WARN);
|
||||
highest.title.should.equal('Warning, LOW predicted');
|
||||
|
||||
done();
|
||||
|
||||
@@ -2,6 +2,8 @@ const should = require('should');
|
||||
const fs = require('fs');
|
||||
const language = require('../lib/language')(fs);
|
||||
|
||||
const helper = require('./inithelper')();
|
||||
|
||||
describe('basalprofile', function ( ) {
|
||||
|
||||
var sandbox = require('../lib/sandbox')();
|
||||
@@ -51,8 +53,7 @@ describe('basalprofile', function ( ) {
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
var profile = require('../lib/profilefunctions')([profileData]);
|
||||
var profile = require('../lib/profilefunctions')([profileData], helper.ctx);
|
||||
|
||||
it('update basal profile pill', function (done) {
|
||||
var data = {};
|
||||
@@ -68,7 +69,9 @@ describe('basalprofile', function ( ) {
|
||||
, language: language
|
||||
};
|
||||
|
||||
var time = new Date('2015-06-21T00:00:00+00:00').getTime();
|
||||
var time = new Date('2015-06-21T00:00:00+00:00');
|
||||
|
||||
console.log('TIME1', time);
|
||||
|
||||
var sbx = sandbox.clientInit(ctx, time, data);
|
||||
sbx.data.profile = profile;
|
||||
@@ -86,7 +89,7 @@ describe('basalprofile', function ( ) {
|
||||
, language: language
|
||||
};
|
||||
|
||||
var time = new Date('2015-06-21T00:00:00+00:00').getTime();
|
||||
var time = new Date('2015-06-21T00:00:00+00:00');
|
||||
|
||||
var sbx = sandbox.clientInit(ctx, time, data);
|
||||
sbx.data.profile = profile;
|
||||
|
||||
+6
-5
@@ -2,17 +2,14 @@
|
||||
|
||||
var should = require('should');
|
||||
var _ = require('lodash');
|
||||
const helper = require('./inithelper')();
|
||||
|
||||
var FIVE_MINS = 300000;
|
||||
var SIX_MINS = 360000;
|
||||
|
||||
describe('BG Now', function ( ) {
|
||||
var ctx = {
|
||||
language: require('../lib/language')()
|
||||
, settings: require('../lib/settings')()
|
||||
};
|
||||
|
||||
ctx.levels = require('../lib/levels');
|
||||
const ctx = helper.ctx;
|
||||
|
||||
var bgnow = require('../lib/plugins/bgnow')(ctx);
|
||||
var sandbox = require('../lib/sandbox')(ctx);
|
||||
@@ -70,6 +67,7 @@ describe('BG Now', function ( ) {
|
||||
}
|
||||
}
|
||||
, language: require('../lib/language')()
|
||||
, moment: helper.ctx.moment
|
||||
};
|
||||
|
||||
var sbx = sandbox.clientInit(ctx, now, data);
|
||||
@@ -92,6 +90,7 @@ describe('BG Now', function ( ) {
|
||||
}
|
||||
, pluginBase: {}
|
||||
, language: require('../lib/language')()
|
||||
, moment: helper.ctx.moment
|
||||
};
|
||||
|
||||
var data = {sgvs: [{mills: before, mgdl: 100}, {mills: now, mgdl: 105}]};
|
||||
@@ -137,6 +136,7 @@ describe('BG Now', function ( ) {
|
||||
}
|
||||
, pluginBase: {}
|
||||
, language: require('../lib/language')()
|
||||
, moment: helper.ctx.moment
|
||||
};
|
||||
|
||||
var data = {sgvs: [{mills: before, mgdl: 85}, {mills: now, mgdl: 85}]};
|
||||
@@ -183,6 +183,7 @@ describe('BG Now', function ( ) {
|
||||
}
|
||||
, pluginBase: {}
|
||||
, language: require('../lib/language')()
|
||||
, moment: helper.ctx.moment
|
||||
};
|
||||
|
||||
var data = {sgvs: [{mills: before - SIX_MINS, mgdl: 100}, {mills: now, mgdl: 105}]};
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
var should = require('should');
|
||||
var Stream = require('stream');
|
||||
var levels = require('../lib/levels');
|
||||
const helper = require('./inithelper')();
|
||||
|
||||
describe('boluswizardpreview', function ( ) {
|
||||
var env = require('../lib/server/env')();
|
||||
env.testMode = true;
|
||||
|
||||
var ctx = {
|
||||
settings: {}
|
||||
, language: require('../lib/language')()
|
||||
, levels: levels
|
||||
};
|
||||
var ctx = helper.getctx();
|
||||
|
||||
ctx.ddata = require('../lib/data/ddata')();
|
||||
ctx.notifications = require('../lib/notifications')(env, ctx);
|
||||
|
||||
@@ -138,6 +135,7 @@ describe('boluswizardpreview', function ( ) {
|
||||
units: 'mmol'
|
||||
}
|
||||
, pluginBase: {}
|
||||
, moment: helper.ctx.moment
|
||||
};
|
||||
|
||||
ctx.language = require('../lib/language')();
|
||||
@@ -145,7 +143,7 @@ describe('boluswizardpreview', function ( ) {
|
||||
var data = {sgvs: [{mills: before, mgdl: 100}, {mills: now, mgdl: 100}]};
|
||||
data.treatments = [{mills: now, insulin: '1.0'}];
|
||||
data.devicestatus = [];
|
||||
data.profile = require('../lib/profilefunctions')([profileData]);
|
||||
data.profile = require('../lib/profilefunctions')([profileData], ctx);
|
||||
var sbx = sandbox.clientInit(ctx, Date.now(), data);
|
||||
sbx.properties.iob = iob.calcTotal(data.treatments, data.devicestatus, data.profile, now);
|
||||
|
||||
@@ -181,6 +179,7 @@ describe('boluswizardpreview', function ( ) {
|
||||
units: 'mmol'
|
||||
}
|
||||
, pluginBase: {}
|
||||
, moment: helper.ctx.moment
|
||||
};
|
||||
|
||||
ctx.language = require('../lib/language')();
|
||||
@@ -188,7 +187,7 @@ describe('boluswizardpreview', function ( ) {
|
||||
var data = {sgvs: [{mills: before, mgdl: 175}, {mills: now, mgdl: 153}]};
|
||||
data.treatments = [{mills: now, insulin: '0.45'}];
|
||||
data.devicestatus = [];
|
||||
data.profile = require('../lib/profilefunctions')([profileData]);
|
||||
data.profile = require('../lib/profilefunctions')([profileData], ctx);
|
||||
var sbx = sandbox.clientInit(ctx, Date.now(), data);
|
||||
sbx.properties.iob = iob.calcTotal(data.treatments, data.devicestatus, data.profile, now);
|
||||
|
||||
@@ -229,7 +228,7 @@ describe('boluswizardpreview', function ( ) {
|
||||
boluswizardpreview.checkNotifications(sbx);
|
||||
|
||||
var highest = ctx.notifications.findHighestAlarm();
|
||||
highest.level.should.equal(levels.WARN);
|
||||
highest.level.should.equal(ctx.levels.WARN);
|
||||
highest.title.should.equal('Warning, Check BG, time to bolus?');
|
||||
highest.message.should.equal('BG Now: 180 +5 ↗ mg/dl\nBG 15m: 187 mg/dl\nBWP: 0.66U');
|
||||
done();
|
||||
@@ -240,11 +239,10 @@ describe('boluswizardpreview', function ( ) {
|
||||
ctx.ddata.sgvs = [{mills: before, mgdl: 295}, {mills: now, mgdl: 300}];
|
||||
ctx.ddata.treatments = [];
|
||||
ctx.ddata.profiles = [profile];
|
||||
ctx.levels = require('../lib/levels');
|
||||
|
||||
var sbx = prepareSandbox();
|
||||
boluswizardpreview.checkNotifications(sbx);
|
||||
ctx.notifications.findHighestAlarm().level.should.equal(levels.URGENT);
|
||||
ctx.notifications.findHighestAlarm().level.should.equal(ctx.levels.URGENT);
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -285,10 +283,11 @@ describe('boluswizardpreview', function ( ) {
|
||||
done();
|
||||
}
|
||||
}
|
||||
, moment: helper.ctx.moment
|
||||
};
|
||||
|
||||
ctx.language = require('../lib/language')();
|
||||
var loadedProfile = require('../lib/profilefunctions')();
|
||||
var loadedProfile = require('../lib/profilefunctions')(null, ctx);
|
||||
loadedProfile.loadData([profile]);
|
||||
|
||||
var data = {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
require('should');
|
||||
var levels = require('../lib/levels');
|
||||
const helper = require('./inithelper')();
|
||||
const levels = helper.ctx.levels;
|
||||
|
||||
describe('cage', function ( ) {
|
||||
var env = require('../lib/server/env')();
|
||||
var ctx = {};
|
||||
var ctx = helper.getctx();
|
||||
|
||||
ctx.ddata = require('../lib/data/ddata')();
|
||||
ctx.notifications = require('../lib/notifications')(env, ctx);
|
||||
ctx.language = require('../lib/language')();
|
||||
ctx.levels = levels;
|
||||
|
||||
var cage = require('../lib/plugins/cannulaage')(ctx);
|
||||
var sandbox = require('../lib/sandbox')(ctx);
|
||||
|
||||
+3
-6
@@ -1,15 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const fs = require('fs');
|
||||
const language = require('../lib/language')(fs);
|
||||
const helper = require('./inithelper')();
|
||||
|
||||
require('should');
|
||||
|
||||
describe('COB', function ( ) {
|
||||
var ctx = {};
|
||||
ctx.settings = {};
|
||||
ctx.language = language;
|
||||
var ctx = helper.ctx;
|
||||
|
||||
var cob = require('../lib/plugins/cob')(ctx);
|
||||
|
||||
@@ -20,7 +17,7 @@ describe('COB', function ( ) {
|
||||
, carbs_hr: 30
|
||||
};
|
||||
|
||||
var profile = require('../lib/profilefunctions')([profileData]);
|
||||
var profile = require('../lib/profilefunctions')([profileData], ctx);
|
||||
|
||||
it('should calculate IOB, multiple treatments', function() {
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
const fs = require('fs');
|
||||
const moment = require('moment-timezone');
|
||||
const language = require('../lib/language')(fs);
|
||||
const settings = require('../lib/settings')();
|
||||
const levels = require('../lib/levels');
|
||||
|
||||
function helper() {
|
||||
|
||||
helper.ctx = {
|
||||
language: language
|
||||
, settings: settings
|
||||
, levels: levels
|
||||
, moment: moment
|
||||
};
|
||||
|
||||
helper.getctx = function getctx () {
|
||||
return helper.ctx;
|
||||
}
|
||||
|
||||
return helper;
|
||||
}
|
||||
|
||||
module.exports = helper;
|
||||
@@ -1,15 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
require('should');
|
||||
var levels = require('../lib/levels');
|
||||
const helper = require('./inithelper')();
|
||||
const levels = helper.ctx.levels;
|
||||
|
||||
describe('insulinage', function ( ) {
|
||||
var env = require('../lib/server/env')();
|
||||
var ctx = {};
|
||||
ctx.levels = levels;
|
||||
var ctx = helper.getctx();
|
||||
ctx.ddata = require('../lib/data/ddata')();
|
||||
ctx.notifications = require('../lib/notifications')(env, ctx);
|
||||
ctx.language = require('../lib/language')();
|
||||
|
||||
var iage = require('../lib/plugins/insulinage')(ctx);
|
||||
var sandbox = require('../lib/sandbox')(ctx);
|
||||
|
||||
+7
-7
@@ -2,11 +2,12 @@
|
||||
|
||||
const _ = require('lodash');
|
||||
const should = require('should');
|
||||
const fs = require('fs');
|
||||
const helper = require('./inithelper')();
|
||||
|
||||
describe('IOB', function() {
|
||||
var ctx = {};
|
||||
ctx.language = require('../lib/language')(fs);
|
||||
|
||||
let ctx = helper.ctx;
|
||||
|
||||
ctx.settings = require('../lib/settings')();
|
||||
|
||||
var iob = require('../lib/plugins/iob')(ctx);
|
||||
@@ -55,7 +56,7 @@ describe('IOB', function() {
|
||||
dia: 3,
|
||||
sens: 0};
|
||||
|
||||
var profile = require('../lib/profilefunctions')([profileData]);
|
||||
var profile = require('../lib/profilefunctions')([profileData], ctx);
|
||||
|
||||
var rightAfterBolus = iob.calcTotal(treatments, [], profile, time);
|
||||
|
||||
@@ -113,8 +114,7 @@ describe('IOB', function() {
|
||||
dia: 4,
|
||||
sens: 0};
|
||||
|
||||
var profile = require('../lib/profilefunctions')([profileData]);
|
||||
|
||||
var profile = require('../lib/profilefunctions')([profileData], ctx);
|
||||
|
||||
var rightAfterBolus = iob.calcTotal(treatments, [], profile, time);
|
||||
|
||||
@@ -140,7 +140,7 @@ describe('IOB', function() {
|
||||
|
||||
describe('from devicestatus', function () {
|
||||
var time = Date.now();
|
||||
var profile = require('../lib/profilefunctions')([{ dia: 3, sens: 0 }]);
|
||||
var profile = require('../lib/profilefunctions')([{ dia: 3, sens: 0 }], ctx);
|
||||
var treatments = [{
|
||||
mills: time - 1,
|
||||
insulin: '3.00'
|
||||
|
||||
+8
-13
@@ -2,17 +2,12 @@
|
||||
|
||||
const _ = require('lodash');
|
||||
const should = require('should');
|
||||
const moment = require('moment');
|
||||
const fs = require('fs');
|
||||
const language = require('../lib/language')(fs);
|
||||
const levels = require('../lib/levels');
|
||||
const helper = require('./inithelper')();
|
||||
|
||||
var ctx_top = {
|
||||
language: language
|
||||
, settings: require('../lib/settings')()
|
||||
, levels: levels
|
||||
};
|
||||
var ctx_top = helper.getctx();
|
||||
ctx_top.language.set('en');
|
||||
const language = ctx_top.language;
|
||||
|
||||
var env = require('../lib/server/env')();
|
||||
var loop = require('../lib/plugins/loop')(ctx_top);
|
||||
var sandbox = require('../lib/sandbox')(ctx_top);
|
||||
@@ -107,10 +102,10 @@ var statuses = [
|
||||
}
|
||||
];
|
||||
|
||||
var now = moment(statuses[0].created_at);
|
||||
var now = ctx_top.moment(statuses[0].created_at);
|
||||
|
||||
_.forEach(statuses, function updateMills (status) {
|
||||
status.mills = moment(status.created_at).valueOf();
|
||||
status.mills = ctx_top.moment(status.created_at).valueOf();
|
||||
});
|
||||
|
||||
describe('loop', function ( ) {
|
||||
@@ -174,7 +169,7 @@ describe('loop', function ( ) {
|
||||
language: language
|
||||
};
|
||||
|
||||
var errorTime = moment(statuses[1].created_at);
|
||||
var errorTime = ctx_top.moment(statuses[1].created_at);
|
||||
|
||||
var sbx = sandbox.clientInit(ctx, errorTime.valueOf(), {devicestatus: statuses});
|
||||
|
||||
@@ -242,7 +237,7 @@ describe('loop', function ( ) {
|
||||
loop.checkNotifications(sbx);
|
||||
|
||||
var highest = ctx.notifications.findHighestAlarm('Loop');
|
||||
highest.level.should.equal(levels.URGENT);
|
||||
highest.level.should.equal(ctx_top.levels.URGENT);
|
||||
highest.title.should.equal('Loop isn\'t looping');
|
||||
done();
|
||||
});
|
||||
|
||||
+7
-11
@@ -2,18 +2,14 @@
|
||||
|
||||
const _ = require('lodash');
|
||||
const should = require('should');
|
||||
const moment = require('moment');
|
||||
const fs = require('fs');
|
||||
|
||||
const language = require('../lib/language')(fs);
|
||||
const helper = require('./inithelper')();
|
||||
|
||||
var top_ctx = {
|
||||
language: language
|
||||
, settings: require('../lib/settings')()
|
||||
};
|
||||
var top_ctx = helper.getctx();
|
||||
top_ctx.language.set('en');
|
||||
var levels = require('../lib/levels');
|
||||
top_ctx.levels = levels;
|
||||
const language = top_ctx.language;
|
||||
const levels = top_ctx.levels;
|
||||
|
||||
var env = require('../lib/server/env')();
|
||||
var openaps = require('../lib/plugins/openaps')(top_ctx);
|
||||
var sandbox = require('../lib/sandbox')(top_ctx);
|
||||
@@ -247,10 +243,10 @@ var statuses = [{
|
||||
"created_at": "2017-09-05T19:19:39.899Z"
|
||||
}];
|
||||
|
||||
var now = moment(statuses[0].created_at);
|
||||
var now = top_ctx.moment(statuses[0].created_at);
|
||||
|
||||
_.forEach(statuses, function updateMills (status) {
|
||||
status.mills = moment(status.created_at).valueOf();
|
||||
status.mills = top_ctx.moment(status.created_at).valueOf();
|
||||
});
|
||||
|
||||
describe('openaps', function ( ) {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
var should = require('should');
|
||||
var moment = require('moment-timezone');
|
||||
const helper = require('./inithelper')();
|
||||
const moment = helper.ctx.moment;
|
||||
|
||||
describe('Profile', function ( ) {
|
||||
|
||||
var profile_empty = require('../lib/profilefunctions')();
|
||||
|
||||
var profile_empty = require('../lib/profilefunctions')(null, helper.ctx);
|
||||
|
||||
beforeEach(function() {
|
||||
profile_empty.clear();
|
||||
@@ -33,7 +35,7 @@ describe('Profile', function ( ) {
|
||||
, 'target_high': 120
|
||||
};
|
||||
|
||||
var profile = require('../lib/profilefunctions')([profileData]);
|
||||
var profile = require('../lib/profilefunctions')([profileData],helper.ctx);
|
||||
var now = Date.now();
|
||||
|
||||
it('should know what the DIA is with old style profiles', function() {
|
||||
@@ -73,7 +75,7 @@ describe('Profile', function ( ) {
|
||||
|
||||
it('should know how to reload data and still know what the low target is with old style profiles', function() {
|
||||
|
||||
var profile2 = require('../lib/profilefunctions')([profileData]);
|
||||
var profile2 = require('../lib/profilefunctions')([profileData], helper.ctx);
|
||||
var profileData2 = {
|
||||
'dia': 3,
|
||||
'carbs_hr': 30,
|
||||
@@ -157,7 +159,7 @@ describe('Profile', function ( ) {
|
||||
'units': 'mmol'
|
||||
};
|
||||
|
||||
var complexProfile = require('../lib/profilefunctions')([complexProfileData]);
|
||||
var complexProfile = require('../lib/profilefunctions')([complexProfileData], helper.ctx);
|
||||
|
||||
var noon = new Date('2015-06-22 12:00:00').getTime();
|
||||
var threepm = new Date('2015-06-22 15:00:00').getTime();
|
||||
@@ -336,7 +338,7 @@ describe('Profile', function ( ) {
|
||||
}
|
||||
];
|
||||
|
||||
var multiProfile = require('../lib/profilefunctions')(multiProfileData);
|
||||
var multiProfile = require('../lib/profilefunctions')(multiProfileData, helper.ctx);
|
||||
|
||||
var noon = new Date('2015-06-22 12:00:00').getTime();
|
||||
var threepm = new Date('2015-06-26 15:00:00').getTime();
|
||||
|
||||
+9
-11
@@ -2,19 +2,18 @@
|
||||
|
||||
var _ = require('lodash');
|
||||
var should = require('should');
|
||||
var moment = require('moment');
|
||||
const fs = require('fs');
|
||||
const language = require('../lib/language')(fs);
|
||||
const helper = require('./inithelper')();
|
||||
const moment = helper.ctx.moment;
|
||||
|
||||
var top_ctx = {
|
||||
language: language
|
||||
, settings: require('../lib/settings')()
|
||||
};
|
||||
var top_ctx = helper.getctx();
|
||||
top_ctx.settings = require('../lib/settings')();
|
||||
top_ctx.language.set('en');
|
||||
|
||||
var env = require('../lib/server/env')();
|
||||
var levels = require('../lib/levels');
|
||||
var profile = require('../lib/profilefunctions')();
|
||||
top_ctx.levels = levels;
|
||||
const levels = top_ctx.levels;
|
||||
const language = top_ctx.language;
|
||||
|
||||
var profile = require('../lib/profilefunctions')(null, top_ctx);
|
||||
var pump = require('../lib/plugins/pump')(top_ctx);
|
||||
var sandbox = require('../lib/sandbox')(top_ctx);
|
||||
|
||||
@@ -93,7 +92,6 @@ var statuses2 = [{
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
var now = moment(statuses[1].created_at);
|
||||
|
||||
_.forEach(statuses, function updateMills (status) {
|
||||
|
||||
@@ -2,15 +2,13 @@
|
||||
|
||||
var should = require('should');
|
||||
var times = require('../lib/times');
|
||||
var levels = require('../lib/levels');
|
||||
const helper = require('./inithelper')();
|
||||
|
||||
describe('sage', function ( ) {
|
||||
var env = require('../lib/server/env')();
|
||||
var ctx = {};
|
||||
ctx.levels = levels;
|
||||
var ctx = helper.getctx();
|
||||
ctx.ddata = require('../lib/data/ddata')();
|
||||
ctx.notifications = require('../lib/notifications')(env, ctx);
|
||||
ctx.language = require('../lib/language')();
|
||||
var sage = require('../lib/plugins/sensorage')(ctx);
|
||||
var sandbox = require('../lib/sandbox')();
|
||||
|
||||
@@ -152,7 +150,7 @@ describe('sage', function ( ) {
|
||||
sage.checkNotifications(sbx);
|
||||
|
||||
var highest = ctx.notifications.findHighestAlarm('SAGE');
|
||||
highest.level.should.equal(levels.URGENT);
|
||||
highest.level.should.equal(ctx.levels.URGENT);
|
||||
highest.title.should.equal('Sensor age 6 days 22 hours');
|
||||
done();
|
||||
});
|
||||
|
||||
+9
-5
@@ -2,14 +2,18 @@
|
||||
|
||||
require('should');
|
||||
|
||||
const helper = require('./inithelper')();
|
||||
|
||||
describe('utils', function ( ) {
|
||||
var utils = require('../lib/utils')({
|
||||
language: require('../lib/language')()
|
||||
, settings: {
|
||||
|
||||
const ctx = helper.getctx();
|
||||
|
||||
ctx.settings = {
|
||||
alarmTimeagoUrgentMins: 30
|
||||
, alarmTimeagoWarnMins: 15
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var utils = require('../lib/utils')(ctx);
|
||||
|
||||
it('format numbers', function () {
|
||||
utils.toFixed(5.499999999).should.equal('5.50');
|
||||
|
||||
@@ -2,7 +2,7 @@ const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const pluginArray = [];
|
||||
const sourceMapType = 'source-map';
|
||||
const MomentTimezoneDataPlugin = require('moment-timezone-data-webpack-plugin');
|
||||
//const MomentTimezoneDataPlugin = require('moment-timezone-data-webpack-plugin');
|
||||
const projectRoot = path.resolve(__dirname, '..');
|
||||
|
||||
/*
|
||||
@@ -56,12 +56,14 @@ pluginArray.push(new webpack.ProvidePlugin({
|
||||
process: 'process/browser',
|
||||
}));
|
||||
|
||||
/*
|
||||
// limit Timezone data from Moment
|
||||
|
||||
pluginArray.push(new MomentTimezoneDataPlugin({
|
||||
startYear: 2015,
|
||||
endYear: 2035,
|
||||
}));
|
||||
*/
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||
|
||||
Reference in New Issue
Block a user