summaryrefslogtreecommitdiff
path: root/node_modules/postcss-reporter/lib/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/postcss-reporter/lib/util.js')
-rw-r--r--node_modules/postcss-reporter/lib/util.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/node_modules/postcss-reporter/lib/util.js b/node_modules/postcss-reporter/lib/util.js
index 76c649bc..094b3acc 100644
--- a/node_modules/postcss-reporter/lib/util.js
+++ b/node_modules/postcss-reporter/lib/util.js
@@ -1,6 +1,4 @@
-var _ = require('lodash');
-
-exports.getLocation = function(message) {
+exports.getLocation = function (message) {
var messageNode = message.node;
var location = {
@@ -8,12 +6,13 @@ exports.getLocation = function(message) {
column: message.column,
};
- var messageInput = _.get(messageNode, 'source.input');
+ 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
+ var originLocation =
+ messageInput.origin && messageInput.origin(message.line, message.column);
+ if (originLocation) return originLocation;
location.file = messageInput.file || messageInput.id;
return location;