rsnext/packages/next/compiled/p-limit/index.js
Jiachi Liu 8668020a54
Upgrade typescript to 4.8.2 (#39979)
Typescript published 4.8.2 today and it fails CI, bump our typescript version to 4.8.2 and tweak some typings to make existing e2e typescript tests work properly

* Bump web-vitals from 3.0.0-beta to 3.0.0 stable for typing fix (there's an undefined type but it wasn't caught by ts 4.7), also force compiled it as CJS for pre-compiled
* Bump ncc to 3.34.0 for ts-loader compatibility for new typescript version, ncc 3.33.x cannot work with ts 4.8
* Update pre-compiled
2022-08-29 16:56:02 +00:00

1 line
No EOL
1.5 KiB
JavaScript

(()=>{var e={758:(e,t,i)=>{"use strict";const r=i(738);const pLimit=e=>{if(!((Number.isInteger(e)||e===Infinity)&&e>0)){throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const t=new r;let i=0;const next=()=>{i--;if(t.size>0){t.dequeue()()}};const run=async(e,t,...r)=>{i++;const s=(async()=>e(...r))();t(s);try{await s}catch{}next()};const enqueue=(r,s,...n)=>{t.enqueue(run.bind(null,r,s,...n));(async()=>{await Promise.resolve();if(i<e&&t.size>0){t.dequeue()()}})()};const generator=(e,...t)=>new Promise((i=>{enqueue(e,i,...t)}));Object.defineProperties(generator,{activeCount:{get:()=>i},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}});return generator};e.exports=pLimit},738:e=>{class Node{constructor(e){this.value=e;this.next=undefined}}class Queue{constructor(){this.clear()}enqueue(e){const t=new Node(e);if(this._head){this._tail.next=t;this._tail=t}else{this._head=t;this._tail=t}this._size++}dequeue(){const e=this._head;if(!e){return}this._head=this._head.next;this._size--;return e.value}clear(){this._head=undefined;this._tail=undefined;this._size=0}get size(){return this._size}*[Symbol.iterator](){let e=this._head;while(e){yield e.value;e=e.next}}}e.exports=Queue}};var t={};function __nccwpck_require__(i){var r=t[i];if(r!==undefined){return r.exports}var s=t[i]={exports:{}};var n=true;try{e[i](s,s.exports,__nccwpck_require__);n=false}finally{if(n)delete t[i]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(758);module.exports=i})();