Skip to content

Commit

Permalink
chore: remove addMetas already implemented in master
Browse files Browse the repository at this point in the history
  • Loading branch information
tkurki committed Dec 13, 2021
1 parent 6a8e2e1 commit d4b3e59
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/fullsignalk.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,32 +188,6 @@ function addValues(context, contextPath, source, timestamp, pathValues) {
}
}

function addMetas(context, contextPath, source, timestamp, metas) {
var len = metas.length;
for (var i = 0; i < len; ++i) {
addMeta(context, contextPath, source, timestamp, metas[i]);
}
}

function addMeta(context, contextPath, source, timestamp, pathValue) {
if (_.isUndefined(pathValue.path) || _.isUndefined(pathValue.value)) {
console.error("Illegal value in delta:" + JSON.stringify(pathValue));
return;
}
var valueLeaf;

const splitPath = pathValue.path.split('.');

valueLeaf = splitPath.reduce(function(previous, pathPart, i) {
if (!previous[pathPart]) {
previous[pathPart] = {};
}
return previous[pathPart];
}, context);

valueLeaf.meta = _.merge(valueLeaf.meta || {}, pathValue.value)
}

function addValue(context, contextPath, source, timestamp, pathValue) {
let errMessage = ""
if(_.isUndefined(pathValue.path)){
Expand Down

0 comments on commit d4b3e59

Please sign in to comment.