mirror of
https://github.com/zyachel/quetre.git
synced 2025-04-04 13:37:39 +03:00
11 lines
291 B
JavaScript
11 lines
291 B
JavaScript
const invalidLessThan = /\\x3C/g;
|
|
const validLessThan = '\\u003C';
|
|
|
|
/**
|
|
* parses and corrects invalid escape sequences
|
|
* @param {string} data
|
|
* @returns {Record<PropertyKey, any>}
|
|
*/
|
|
const parse = data => JSON.parse(data.replace(invalidLessThan, validLessThan));
|
|
|
|
export default parse;
|