feat: migrate to starlight

This commit is contained in:
DuroCodes
2024-05-06 17:15:30 -04:00
parent 767acedea7
commit bb190f2d81
15140 changed files with 2828326 additions and 35408 deletions

30
node_modules/p-queue/dist/priority-queue.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import lowerBound from './lower-bound.js';
export default class PriorityQueue {
#queue = [];
enqueue(run, options) {
options = {
priority: 0,
...options,
};
const element = {
priority: options.priority,
run,
};
if (this.size && this.#queue[this.size - 1].priority >= options.priority) {
this.#queue.push(element);
return;
}
const index = lowerBound(this.#queue, element, (a, b) => b.priority - a.priority);
this.#queue.splice(index, 0, element);
}
dequeue() {
const item = this.#queue.shift();
return item?.run;
}
filter(options) {
return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run);
}
get size() {
return this.#queue.length;
}
}