Afanasev_Stepan_PIbd-21_IP/ИП 3 лаба/node_modules/json-parse-helpfulerror/index.js~
[USERNAME] 0dd26716dc Lab2-5
2024-01-10 16:11:49 +04:00

21 lines
372 B
JavaScript

'use strict';
var jju = require('jju');
function parse(text, reviver) {
try {
return JSON.parse(text, reviver);
} catch(err) {
// we expect this throw with a more informative message
jju.parse(text, {
mode: 'json',
reviver: reviver
});
// if it didn't throw, re-throw the original error
throw err;
}
}
module.exports = parse;