UNPKG

@stringsync/vexml

Version:

MusicXML to Vexflow

28 lines (27 loc) 520 B
export 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; } } export default Stack;