You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
590 B

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findEndingQuote = void 0;
const findEndingQuote = (uint8, x) => {
const len = uint8.length;
let char = uint8[x];
let prev = 0;
while (x < len) {
if (char === 34 && prev !== 92)
break;
if (char === 92 && prev === 92)
prev = 0;
else
prev = char;
char = uint8[++x];
}
if (x === len)
throw new Error('Invalid JSON');
return x;
};
exports.findEndingQuote = findEndingQuote;
//# sourceMappingURL=util.js.map