Last change
on this file since 84d0fbb was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
374 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | const fs = require('fs')
|
---|
| 2 | const JSON5 = require('./')
|
---|
| 3 |
|
---|
| 4 | // eslint-disable-next-line node/no-deprecated-api
|
---|
| 5 | require.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.