full-json-extractor
Version:
Brute-forces all possible highest-level json candidates with pruning to keep performance fast with reasonable payload < 1MB
35 lines • 835 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Queue = void 0;
class Queue {
popQueue;
pushQueue;
constructor(...value) {
this.popQueue = [];
this.pushQueue = value;
}
migratePushToPopQueue() {
while (this.pushQueue.length) {
this.popQueue.push(this.pushQueue.pop());
}
}
enqueue(...value) {
this.pushQueue.push(...value);
}
dequeue() {
if (!this.popQueue.length) {
this.migratePushToPopQueue();
}
if (!this.popQueue.length) {
return null;
}
else {
return this.popQueue.pop();
}
}
length() {
return this.popQueue.length + this.pushQueue.length;
}
}
exports.Queue = Queue;
//# sourceMappingURL=queue.js.map