aboutsummaryrefslogtreecommitdiff
path: root/node_modules/cosmiconfig/lib/parseJson.js
blob: 5541daf5a50f239a6c69d071d5c843a8cacfaab5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
'use strict';

var parseJson = require('parse-json');

module.exports = function (json, filepath) {
  try {
    return parseJson(json);
  } catch (err) {
    err.message = 'JSON Error in ' + filepath + ':\n' + err.message;
    throw err;
  }
};