source: trip-planner-front/node_modules/json5/lib/register.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 374 bytes
RevLine 
[6a3a178]1const fs = require('fs')
2const JSON5 = require('./')
3
4// eslint-disable-next-line node/no-deprecated-api
5require.extensions['.json5'] = function (module, filename) {
6 const content = fs.readFileSync(filename, 'utf8')
7 try {
8 module.exports = JSON5.parse(content)
9 } catch (err) {
10 err.message = filename + ': ' + err.message
11 throw err
12 }
13}
Note: See TracBrowser for help on using the repository browser.