documentation.federated.com.../node_modules/postcss-reporter/lib/util.js
2023-05-30 11:55:11 -06:00

20 lines
504 B
JavaScript

exports.getLocation = function (message) {
var messageNode = message.node;
var location = {
line: message.line,
column: message.column,
};
var messageInput = messageNode && messageNode.source && 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;
};