lix-website/themes/lix/assets/bootstrap/node_modules/json5/lib/register.js

14 lines
374 B
JavaScript
Raw Normal View History

2024-04-27 03:39:10 +00:00
const fs = require('fs')
const JSON5 = require('./')
// eslint-disable-next-line node/no-deprecated-api
require.extensions['.json5'] = function (module, filename) {
const content = fs.readFileSync(filename, 'utf8')
try {
module.exports = JSON5.parse(content)
} catch (err) {
err.message = filename + ': ' + err.message
throw err
}
}