GT2/GT2-iOS/node_modules/default-require-extensions/json.js

15 lines
314 B
JavaScript
Raw Normal View History

2018-02-12 17:26:06 +00:00
'use strict';
var fs = require('fs');
var stripBom = require('strip-bom');
module.exports = function (module, filename) {
var content = fs.readFileSync(filename, 'utf8');
try {
module.exports = JSON.parse(stripBom(content));
} catch (err) {
err.message = filename + ': ' + err.message;
throw err;
}
};