@stringsync/vexml
Version:
MusicXML to Vexflow
32 lines (31 loc) • 640 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Stack = void 0;
class Stack {
items = new Array();
push(item) {
this.items.push(item);
}
pop() {
return this.items.pop();
}
peek() {
return this.items[this.items.length - 1];
}
isEmpty() {
return this.items.length === 0;
}
size() {
return this.items.length;
}
clear() {
this.items = [];
}
clone() {
const stack = new Stack();
stack.items = [...this.items];
return stack;
}
}
exports.Stack = Stack;
exports.default = Stack;