@u4/adbkit-monkey
Version:
A Node.js interface to the Android monkey tool.
30 lines (29 loc) • 658 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Queue {
constructor() {
this.head = null;
this.tail = null;
}
enqueue(item) {
if (this.tail) {
this.tail.next = item;
}
else {
this.head = item;
}
this.tail = item;
}
dequeue() {
const item = this.head;
if (item) {
if (item === this.tail) {
this.tail = null;
}
this.head = item.next;
item.next = null;
}
return item;
}
}
exports.default = Queue;