dashboardjavacloudcoapiotiot-analyticsiot-platformiot-solutionskafkalwm2mmicroservicesmiddlewaremqttnettyplatformsnmpthingsboardvisualizationwebsocketswidgets
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
498 B
20 lines
498 B
var _ = require('lodash');
|
|
|
|
exports.getLocation = function(message) {
|
|
var messageNode = message.node;
|
|
|
|
var location = {
|
|
line: message.line,
|
|
column: message.column,
|
|
};
|
|
|
|
var messageInput = _.get(messageNode, 'source.input');
|
|
|
|
if (!messageInput) return location;
|
|
|
|
var originLocation = messageInput.origin && messageInput.origin(message.line, message.column)
|
|
if (originLocation) return originLocation
|
|
|
|
location.file = messageInput.file || messageInput.id;
|
|
return location;
|
|
};
|
|
|