create-storybook
Version:
Storybook installer: Develop, document, and test UI components in isolation
9 lines (6 loc) • 805 B
JavaScript
import ESM_COMPAT_Module1 from 'node:module';
import 'node:url';
import 'node:path';
ESM_COMPAT_Module1.createRequire(import.meta.url);
var Node=class{value;next;constructor(value){this.value=value;}},Queue=class{#head;#tail;#size;constructor(){this.clear();}enqueue(value){let node=new Node(value);this.#head?(this.#tail.next=node,this.#tail=node):(this.#head=node,this.#tail=node),this.#size++;}dequeue(){let current=this.#head;if(current)return this.#head=this.#head.next,this.#size--,current.value}peek(){if(this.#head)return this.#head.value}clear(){this.#head=void 0,this.#tail=void 0,this.#size=0;}get size(){return this.#size}*[Symbol.iterator](){let current=this.#head;for(;current;)yield current.value,current=current.next;}*drain(){for(;this.#head;)yield this.dequeue();}};
export { Queue };