Skip to content

Commit 8da4bcf

Browse files
committed
update merge package version
update to merge v2.1.1 due to vulnerability in 1.2.1 consequently a breakage is introduced - cloning regular expressions no longer works, so merge(false, ...) needs to be called instead - should have no impact on gateway app even if references to original merged metrics are kept in merged objects.
1 parent 309442e commit 8da4bcf

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

gateway.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ global.loadMetricsFile = function(file, globalizeFunctions, fatal) {
9595
try {
9696
var tmp = require(file);
9797
if (!global.metricsDef) global.metricsDef = {};
98-
metricsDef.metrics = merge(true, metricsDef.metrics, tmp.metrics);
99-
metricsDef.motes = merge(true, metricsDef.motes, tmp.motes);
100-
metricsDef.events = merge(true, metricsDef.events, tmp.events);
98+
metricsDef.metrics = merge(false, metricsDef.metrics, tmp.metrics);
99+
metricsDef.motes = merge(false, metricsDef.motes, tmp.motes);
100+
metricsDef.events = merge(false, metricsDef.events, tmp.events);
101101
if (globalizeFunctions) {
102102
Object.getOwnPropertyNames(tmp).forEach(function(variable){
103103
let type = typeof tmp[variable];
@@ -111,7 +111,7 @@ global.loadMetricsFile = function(file, globalizeFunctions, fatal) {
111111
delete tmp.metrics;
112112
delete tmp.motes;
113113
delete tmp.events;
114-
metricsDef = merge(true, metricsDef, tmp); //merge anything else (properties, variables, objects, functions)
114+
metricsDef = merge(false, metricsDef, tmp); //merge anything else (properties, variables, objects, functions)
115115
} catch (ex) {
116116
console.error(`FAIL LOADING METRICS MODULE [${file}]: ${ex.message}\n${ex.stack}`);
117117
if (fatal) throw ex;

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
},
1010
"author": "Felix Rusu (https://github.com/LowPowerLab)",
1111
"homepage": "http://lowpowerlab.com/gateway",
12-
"license" : "CC-BY-NC-SA-4.0",
12+
"license": "CC-BY-NC-SA-4.0",
1313
"bugs": {
1414
"url": "https://github.com/LowPowerLab/RaspberryPi-Gateway/issues",
15-
"email": "bugs@lowpowerlab.com"
15+
"email": "support@lowpowerlab.com"
1616
},
1717
"contributors": "Felix Rusu (https://github.com/LowPowerLab)",
1818
"dependencies": {
1919
"colors": "~1.4",
2020
"console-stamp": "^0.2.7",
2121
"json5": "~2.1.0",
22-
"merge": "^1.2.1",
22+
"merge": "^2.1.1",
2323
"nconf": "~0.10.0",
2424
"nedb": "~1.8",
2525
"nodemailer": "^6.4.6",

0 commit comments

Comments
 (0)