chore(deps): update dependency glob to v13.0.5 (#71)
Lint / pre-commit Linting (push) Successful in 31s
Test / Run Tests (push) Successful in 20s

This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [glob](https://github.com/isaacs/node-glob) | [`13.0.3` → `13.0.5`](https://renovatebot.com/diffs/npm/glob/13.0.3/13.0.5) | ![age](https://developer.mend.io/api/mc/badges/age/npm/glob/13.0.5?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/glob/13.0.3/13.0.5?slim=true) |

---

### Release Notes

<details>
<summary>isaacs/node-glob (glob)</summary>

### [`v13.0.5`](https://github.com/isaacs/node-glob/compare/v13.0.4...v13.0.5)

[Compare Source](https://github.com/isaacs/node-glob/compare/v13.0.4...v13.0.5)

### [`v13.0.4`](https://github.com/isaacs/node-glob/compare/v13.0.3...v13.0.4)

[Compare Source](https://github.com/isaacs/node-glob/compare/v13.0.3...v13.0.4)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNC4yIiwidXBkYXRlZEluVmVyIjoiNDMuMTQuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiQXV0b21hdGlvbiJdfQ==-->

Reviewed-on: #71
Co-authored-by: Renovate Bot <renovate@horstenkamp.eu>
Co-committed-by: Renovate Bot <renovate@horstenkamp.eu>
This commit was merged in pull request #71.
This commit is contained in:
Renovate authored and Philipp Horstenkamp committed 2026-02-18 20:03:18 +01:00
1 parent 150f8fc15f
commit 2a1480e46b
2 files changed
+12 -12

No files matched your search

+5 -5
View File
@@ -1,16 +1,16 @@
(()=>{var __webpack_modules__={6136:(module,__unused_webpack_exports,__nccwpck_require__)=>{const{ScreepsAPI:ScreepsAPI}=__nccwpck_require__(9546);const core=__nccwpck_require__(7484);const fs=__nccwpck_require__(9896);const{glob:glob}=__nccwpck_require__(8941);const path=__nccwpck_require__(6928);function replacePlaceholders(i,A){const p=(new Date).toISOString();return i.replace(/{{gitHash}}/g,process.env.GITHUB_SHA).replace(/{{gitRef}}/g,process.env.GITHUB_REF).replace(/{{deployTime}}/g,p).replace(/{{hostname}}/g,A)}async function readReplaceAndWriteFiles(i,A,p){const g=A?path.join(A,i):i;const f=await glob(g);let E=f.map((i=>fs.promises.readFile(i,"utf8").then((A=>{A=replacePlaceholders(A,p);return fs.promises.writeFile(i,A)}))));await Promise.all(E);return f}async function readFilesIntoDict(i,A){const p=A?path.join(A,i):i;const g=await glob(p);let f={};let E=g.map((i=>fs.promises.readFile(i,"utf8").then((p=>{let g=i;if(A&&i.startsWith(A)){g=g.slice(A.length)}g=path.basename(g,path.extname(g));f[g]=p}))));await Promise.all(E);return f}function validateAuthentication(i,A,p){if(i){if(A||p){return"Token is defined along with username and/or password."}}else{if(!A&&!p){return"Neither token nor password and username are defined."}if(A&&!p){return"Username is defined but no password is provided."}if(!A&&p){return"Password is defined but no username is provided."}}return null}async function postCode(){const i=core.getInput("protocol")||"https";const A=core.getInput("hostname")||"screeps.com";const p=core.getInput("port")||"443";const g=core.getInput("path")||"/";const f=core.getInput("token")||undefined;const E=core.getInput("username")||undefined;const C=core.getInput("password")||undefined;const Q=core.getInput("source-prefix");const B=core.getInput("pattern")||"*.js";const I=core.getInput("branch")||"default";const y=core.getInput("git-replace")||null;if(y){await readReplaceAndWriteFiles(y,Q,A)}const w=await readFilesIntoDict(B,Q);core.info(`Trying to upload the following files to ${I}:`);Object.keys(w).forEach((i=>{core.info(`Key: ${i}`)}));const v={token:f,username:E,password:C,protocol:i,hostname:A,port:p,path:g};core.info("login_arguments:");core.info(JSON.stringify(v,null,2));const x=validateAuthentication(f,E,C);if(x){core.error(x);return}let k=new ScreepsAPI(v);if(f){const i=await k.code.set(I,w);core.info(JSON.stringify(i,null,2));console.log(`Code set successfully to ${I}`)}else{core.info(`Logging in as user ${E}`);await Promise.resolve().then((()=>k.auth(E,C,v))).then((()=>{k.code.set(I,w)})).then((()=>{console.log(`Code set successfully to ${I}`)})).catch((i=>{console.error("Error:",i)}))}}if(require.main===require.cache[eval("__filename")]){postCode()}module.exports={validateAuthentication:validateAuthentication,replacePlaceholders:replacePlaceholders,postCode:postCode,readReplaceAndWriteFiles:readReplaceAndWriteFiles,readFilesIntoDict:readFilesIntoDict}},4914:function(i,A,p){"use strict";var g=this&&this.__createBinding||(Object.create?function(i,A,p,g){if(g===undefined)g=p;var f=Object.getOwnPropertyDescriptor(A,p);if(!f||("get"in f?!A.__esModule:f.writable||f.configurable)){f={enumerable:true,get:function(){return A[p]}}}Object.defineProperty(i,g,f)}:function(i,A,p,g){if(g===undefined)g=p;i[g]=A[p]});var f=this&&this.__setModuleDefault||(Object.create?function(i,A){Object.defineProperty(i,"default",{enumerable:true,value:A})}:function(i,A){i["default"]=A});var E=this&&this.__importStar||function(){var ownKeys=function(i){ownKeys=Object.getOwnPropertyNames||function(i){var A=[];for(var p in i)if(Object.prototype.hasOwnProperty.call(i,p))A[A.length]=p;return A};return ownKeys(i)};return function(i){if(i&&i.__esModule)return i;var A={};if(i!=null)for(var p=ownKeys(i),E=0;E<p.length;E++)if(p[E]!=="default")g(A,i,p[E]);f(A,i);return A}}();Object.defineProperty(A,"__esModule",{value:true});A.issueCommand=issueCommand;A.issue=issue;const C=E(p(857));const Q=p(302);function issueCommand(i,A,p){const g=new Command(i,A,p);process.stdout.write(g.toString()+C.EOL)}function issue(i,A=""){issueCommand(i,{},A)}const B="::";class Command{constructor(i,A,p){if(!i){i="missing.command"}this.command=i;this.properties=A;this.message=p}toString(){let i=B+this.command;if(this.properties&&Object.keys(this.properties).length>0){i+=" ";let A=true;for(const p in this.properties){if(this.properties.hasOwnProperty(p)){const g=this.properties[p];if(g){if(A){A=false}else{i+=","}i+=`${p}=${escapeProperty(g)}`}}}}i+=`${B}${escapeData(this.message)}`;return i}}function escapeData(i){return(0,Q.toCommandValue)(i).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(i){return(0,Q.toCommandValue)(i).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},7484:function(i,A,p){"use strict";var g=this&&this.__createBinding||(Object.create?function(i,A,p,g){if(g===undefined)g=p;var f=Object.getOwnPropertyDescriptor(A,p);if(!f||("get"in f?!A.__esModule:fLine truncated
(()=>{var __webpack_modules__={6136:(module,__unused_webpack_exports,__nccwpck_require__)=>{const{ScreepsAPI:ScreepsAPI}=__nccwpck_require__(9546);const core=__nccwpck_require__(7484);const fs=__nccwpck_require__(9896);const{glob:glob}=__nccwpck_require__(8941);const path=__nccwpck_require__(6928);function replacePlaceholders(i,A){const u=(new Date).toISOString();return i.replace(/{{gitHash}}/g,process.env.GITHUB_SHA).replace(/{{gitRef}}/g,process.env.GITHUB_REF).replace(/{{deployTime}}/g,u).replace(/{{hostname}}/g,A)}async function readReplaceAndWriteFiles(i,A,u){const p=A?path.join(A,i):i;const g=await glob(p);let E=g.map((i=>fs.promises.readFile(i,"utf8").then((A=>{A=replacePlaceholders(A,u);return fs.promises.writeFile(i,A)}))));await Promise.all(E);return g}async function readFilesIntoDict(i,A){const u=A?path.join(A,i):i;const p=await glob(u);let g={};let E=p.map((i=>fs.promises.readFile(i,"utf8").then((u=>{let p=i;if(A&&i.startsWith(A)){p=p.slice(A.length)}p=path.basename(p,path.extname(p));g[p]=u}))));await Promise.all(E);return g}function validateAuthentication(i,A,u){if(i){if(A||u){return"Token is defined along with username and/or password."}}else{if(!A&&!u){return"Neither token nor password and username are defined."}if(A&&!u){return"Username is defined but no password is provided."}if(!A&&u){return"Password is defined but no username is provided."}}return null}async function postCode(){const i=core.getInput("protocol")||"https";const A=core.getInput("hostname")||"screeps.com";const u=core.getInput("port")||"443";const p=core.getInput("path")||"/";const g=core.getInput("token")||undefined;const E=core.getInput("username")||undefined;const C=core.getInput("password")||undefined;const Q=core.getInput("source-prefix");const B=core.getInput("pattern")||"*.js";const I=core.getInput("branch")||"default";const y=core.getInput("git-replace")||null;if(y){await readReplaceAndWriteFiles(y,Q,A)}const w=await readFilesIntoDict(B,Q);core.info(`Trying to upload the following files to ${I}:`);Object.keys(w).forEach((i=>{core.info(`Key: ${i}`)}));const v={token:g,username:E,password:C,protocol:i,hostname:A,port:u,path:p};core.info("login_arguments:");core.info(JSON.stringify(v,null,2));const x=validateAuthentication(g,E,C);if(x){core.error(x);return}let k=new ScreepsAPI(v);if(g){const i=await k.code.set(I,w);core.info(JSON.stringify(i,null,2));console.log(`Code set successfully to ${I}`)}else{core.info(`Logging in as user ${E}`);await Promise.resolve().then((()=>k.auth(E,C,v))).then((()=>{k.code.set(I,w)})).then((()=>{console.log(`Code set successfully to ${I}`)})).catch((i=>{console.error("Error:",i)}))}}if(require.main===require.cache[eval("__filename")]){postCode()}module.exports={validateAuthentication:validateAuthentication,replacePlaceholders:replacePlaceholders,postCode:postCode,readReplaceAndWriteFiles:readReplaceAndWriteFiles,readFilesIntoDict:readFilesIntoDict}},4914:function(i,A,u){"use strict";var p=this&&this.__createBinding||(Object.create?function(i,A,u,p){if(p===undefined)p=u;var g=Object.getOwnPropertyDescriptor(A,u);if(!g||("get"in g?!A.__esModule:g.writable||g.configurable)){g={enumerable:true,get:function(){return A[u]}}}Object.defineProperty(i,p,g)}:function(i,A,u,p){if(p===undefined)p=u;i[p]=A[u]});var g=this&&this.__setModuleDefault||(Object.create?function(i,A){Object.defineProperty(i,"default",{enumerable:true,value:A})}:function(i,A){i["default"]=A});var E=this&&this.__importStar||function(){var ownKeys=function(i){ownKeys=Object.getOwnPropertyNames||function(i){var A=[];for(var u in i)if(Object.prototype.hasOwnProperty.call(i,u))A[A.length]=u;return A};return ownKeys(i)};return function(i){if(i&&i.__esModule)return i;var A={};if(i!=null)for(var u=ownKeys(i),E=0;E<u.length;E++)if(u[E]!=="default")p(A,i,u[E]);g(A,i);return A}}();Object.defineProperty(A,"__esModule",{value:true});A.issueCommand=issueCommand;A.issue=issue;const C=E(u(857));const Q=u(302);function issueCommand(i,A,u){const p=new Command(i,A,u);process.stdout.write(p.toString()+C.EOL)}function issue(i,A=""){issueCommand(i,{},A)}const B="::";class Command{constructor(i,A,u){if(!i){i="missing.command"}this.command=i;this.properties=A;this.message=u}toString(){let i=B+this.command;if(this.properties&&Object.keys(this.properties).length>0){i+=" ";let A=true;for(const u in this.properties){if(this.properties.hasOwnProperty(u)){const p=this.properties[u];if(p){if(A){A=false}else{i+=","}i+=`${u}=${escapeProperty(p)}`}}}}i+=`${B}${escapeData(this.message)}`;return i}}function escapeData(i){return(0,Q.toCommandValue)(i).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(i){return(0,Q.toCommandValue)(i).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},7484:function(i,A,u){"use strict";var p=this&&this.__createBinding||(Object.create?function(i,A,u,p){if(p===undefined)p=u;var g=Object.getOwnPropertyDescriptor(A,u);if(!g||("get"in g?!A.__esModule:gLine truncated
/*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*/
i.exports=p(1813)},4096:(i,A,p)=>{"use strict";
i.exports=u(1813)},4096:(i,A,u)=>{"use strict";
/*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/var g=p(9829);var f=p(6928).extname;var E=/^\s*([^;\s]*)(?:;|\s|$)/;var C=/^text\//i;A.charset=charset;A.charsets={lookup:charset};A.contentType=contentType;A.extension=extension;A.extensions=Object.create(null);A.lookup=lookup;A.types=Object.create(null);populateMaps(A.extensions,A.types);function charset(i){if(!i||typeof i!=="string"){return false}var A=E.exec(i);var p=A&&g[A[1].toLowerCase()];if(p&&p.charset){return p.charset}if(A&&C.test(A[1])){return"UTF-8"}return false}function contentType(i){if(!i||typeof i!=="string"){return false}var p=i.indexOf("/")===-1?A.lookup(i):i;if(!p){return false}if(p.indexOf("charset")===-1){var g=A.charset(p);if(g)p+="; charset="+g.toLowerCase()}return p}function extension(i){if(!i||typeof i!=="string"){return false}var p=E.exec(i);var g=p&&A.extensions[p[1].toLowerCase()];if(!g||!g.length){return false}return g[0]}function lookup(i){if(!i||typeof i!=="string"){return false}var p=f("x."+i).toLowerCase().substr(1);if(!p){return false}return A.types[p]||false}function populateMaps(i,A){var p=["nginx","apache",undefined,"iana"];Object.keys(g).forEach((function forEachMimeType(f){var E=g[f];var C=E.extensions;if(!C||!C.length){return}i[f]=C;for(var Q=0;Q<C.length;Q++){var B=C[Q];if(A[B]){var I=p.indexOf(g[A[B]].source);var y=p.indexOf(E.source);if(A[B]!=="application/octet-stream"&&(I>y||I===y&&A[B].substr(0,12)==="application/")){continue}}A[B]=f}}))}},744:i=>{var A=1e3;var p=A*60;var g=p*60;var f=g*24;var E=f*7;var C=f*365.25;i.exports=function(i,A){A=A||{};var p=typeof i;if(p==="string"&&i.length>0){return parse(i)}else if(p==="number"&&isFinite(i)){return A.long?fmtLong(i):fmtShort(i)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function parse(i){i=String(i);if(i.length>100){return}var Q=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!Q){return}var B=parseFloat(Q[1]);var I=(Q[2]||"ms").toLowerCase();switch(I){case"years":case"year":case"yrs":case"yr":case"y":return B*C;case"weeks":case"week":case"w":return B*E;case"days":case"day":case"d":return B*f;case"hours":case"hour":case"hrs":case"hr":case"h":return B*g;case"minutes":case"minute":case"mins":case"min":case"m":return B*p;case"seconds":case"second":case"secs":case"sec":case"s":return B*A;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return B;default:return undefined}}function fmtShort(i){var E=Math.abs(i);if(E>=f){return Math.round(i/f)+"d"}if(E>=g){return Math.round(i/g)+"h"}if(E>=p){return Math.round(i/p)+"m"}if(E>=A){return Math.round(i/A)+"s"}return i+"ms"}function fmtLong(i){var E=Math.abs(i);if(E>=f){return plural(i,E,f,"day")}if(E>=g){return plural(i,E,g,"hour")}if(E>=p){return plural(i,E,p,"minute")}if(E>=A){return plural(i,E,A,"second")}return i+" ms"}function plural(i,A,p,g){var f=A>=p*1.5;return Math.round(i/p)+" "+g+(f?"s":"")}},7777:(i,A,p)=>{"use strict";var g=p(7016).parse;var f={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var E=String.prototype.endsWith||function(i){return i.length<=this.length&&this.indexOf(i,this.length-i.length)!==-1};function getProxyForUrl(i){var A=typeof i==="string"?g(i):i||{};var p=A.protocol;var E=A.host;var C=A.port;if(typeof E!=="string"||!E||typeof p!=="string"){return""}p=p.split(":",1)[0];E=E.replace(/:\d*$/,"");C=parseInt(C)||f[p]||0;if(!shouldProxy(E,C)){return""}var Q=getEnv("npm_config_"+p+"_proxy")||getEnv(p+"_proxy")||getEnv("npm_config_proxy")||getEnv("all_proxy");if(Q&&Q.indexOf("://")===-1){Q=p+"://"+Q}return Q}function shouldProxy(i,A){var p=(getEnv("npm_config_no_proxy")||getEnv("no_proxy")).toLowerCase();if(!p){return true}if(p==="*"){return false}return p.split(/[,\s]/).every((function(p){if(!p){return true}var g=p.match(/^(.+):(\d+)$/);var f=g?g[1]:p;var C=g?parseInt(g[2]):0;if(C&&C!==A){return true}if(!/^[.*]/.test(f)){return i!==f}if(f.charAt(0)==="*"){f=f.slice(1)}return!E.call(i,f)}))}function getEnv(i){return process.env[i.toLowerCase()]||process.env[i.toUpperCase()]||""}A.T=getProxyForUrl},9546:(i,A,p)=>{"use strict";Object.defineProperty(A,"__esModule",{value:true});const g=p(1354);const f=p(7016);const E=p(4434);const C=p(2830);const Q=p(3106);const B=p(4922);const I=p(9023);const y=p(9896);const w=p(9557);const v=p(6928);function _interopDefaultLegacy(i){return i&&typeof i==="object"&&"default"in i?i:{default:i}}const x=_interopDefaultLegacy(g);const k=_interopDefaultLegacy(f);const S=_interopDefaultLegacy(C);const D=_interopDefaultLegacy(Q);const N=_interopDefaultLegacy(B);const T=_interopDefaultLegacy(I);const M=_interopDefaultLegacy(y);const U=_interopDefaultLegacy(w);const L=_interopDefaultLegacy(v);const _=S["default"]("screepsapi:socket");const O={reconnect:true,resubscribe:true,keepAlive:true,maxRetries:10,maxRetryDelay:60*1e3};class Socket extends E.EventEmitter{constructor(i){super();this.api=i;this.opts=Object.assign({},O);this.on("error",(()=>{}));this.reset();this.oLine truncated
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=i=>i.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=i=>i.replace(/\r?\n|\r/g,"\r\n");const g=[];const f=new Uint8Array([13,10]);y=0;let E=false;for(const[A,C]of i){if(typeof C==="string"){const i=O.encode(p+`; name="${escape(normalizeLinefeeds(A))}"`+`\r\n\r\n${normalizeLinefeeds(C)}\r\n`);g.push(i);y+=i.byteLength}else{const i=O.encode(`${p}; name="${escape(normalizeLinefeeds(A))}"`+(C.name?`; filename="${escape(C.name)}"`:"")+"\r\n"+`Content-Type: ${C.type||"application/octet-stream"}\r\n\r\n`);g.push(i,C,f);if(typeof C.size==="number"){y+=i.byteLength+C.size+f.byteLength}else{E=true}}}const C=O.encode(`--${A}--\r\n`);g.push(C);y+=C.byteLength;if(E){y=null}I=i;B=async function*(){for(const i of g){if(i.stream){yield*i.stream()}else{yield i}}};w=`multipart/form-data; boundary=${A}`}else if(E(i)){I=i;y=i.size;if(i.type){w=i.type}}else if(typeof i[Symbol.asyncIterator]==="function"){if(A){throw new TypeError("keepalive")}if(g.isDisturbed(i)||i.locked){throw new TypeError("Response body object should not be disturbed or locked")}p=i instanceof ReadableStream?i:f(i)}if(typeof I==="string"||g.isBuffer(I)){y=Buffer.byteLength(I)}if(B!=null){let A;p=new ReadableStream({async start(){A=B(i)[Symbol.asyncIterator]()},async pull(i){const{value:g,done:f}=await A.next();if(f){queueMicrotask((()=>{i.close();i.byobRequest?.respond(0)}))}else{if(!N(p)){const A=new Uint8Array(g);if(A.byteLength){i.enqueue(A)}}}return i.desiredSize>0},async cancel(i){await A.return()},type:"bytes"})}const v={stream:p,source:I,length:y};return[v,w]}function safelyExtractBody(i,A=false){if(i instanceof ReadableStream){D(!g.isDisturbed(i),"The body has already been consumed.");D(!i.locked,"The stream is locked.")}return extractBody(i,A)}function cloneBody(i,A){const[p,g]=A.stream.tee();A.stream=p;return{stream:g,length:A.length,source:A.source}}function throwIfAborted(i){if(i.aborted){throw new DOMException("The operation was aborted.","AbortError")}}function bodyMixinMethods(i){const A={blob(){return consumeBody(this,(i=>{let A=bodyMimeType(this);if(A===null){A=""}else if(A){A=U(A)}return new S([i],{type:A})}),i)},arrayBuffer(){return consumeBody(this,(i=>new Uint8Array(i).buffer),i)},text(){return consumeBody(this,w,i)},json(){return consumeBody(this,parseJSONFromBytes,i)},formData(){return consumeBody(this,(i=>{const A=bodyMimeType(this);if(A!==null){switch(A.essence){case"multipart/form-data":{const p=L(i,A);if(p==="failure"){throw new TypeError("Failed to parse body as FormData.")}const g=new v;g[x]=p;return g}case"application/x-www-form-urlencoded":{const A=new URLSearchParams(i.toString());const p=new v;for(const[i,g]of A){p.append(i,g)}return p}}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')}),i)},bytes(){return consumeBody(this,(i=>new Uint8Array(i)),i)}};return A}function mixinBody(i){Object.assign(i.prototype,bodyMixinMethods(i))}async function consumeBody(i,A,p){k.brandCheck(i,p);if(bodyUnusable(i)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(i[x]);const g=B();const errorSteps=i=>g.reject(i);const successSteps=i=>{try{g.resolve(A(i))}catch(i){errorSteps(i)}};if(i[x].body==null){successSteps(Buffer.allocUnsafe(0));return g.promise}await I(i[x].body,successSteps,errorSteps);return g.promise}function bodyUnusable(i){const A=i[x].body;return A!=null&&(A.stream.locked||g.isDisturbed(A.stream))}function parseJSONFromBytes(i){return JSON.parse(w(i))}function bodyMimeType(i){const A=i[x].headersList;const p=y(A);if(p==="failure"){return null}return p}i.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:H,hasFinalizationRegistry:G,bodyUnusable:bodyUnusable}},4495:i=>{"use strict";const A=["GET","HEAD","POST"];const p=new Set(A);const g=[101,204,205,304];const f=[301,302,303,307,308];const E=new Set(f);const C=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"];const Q=new Set(C);const B=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"];const I=new Set(B);const y=["follow","manual","error"];const w=["GET","HEAD","OPTIONS","TRACE"];const v=new Set(w);const x=["navigate","same-origin","no-cors","cors"];const k=["omit","same-origin","include"];const S=["default","no-store","reload","no-caLine truncated
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */Q[C-4]=p[0];Q[C-3]=p[1];Q[C-2]=p[2];Q[C-1]=p[3];Q[1]=E;if(E===126){Q.writeUInt16BE(f,2)}else if(E===127){Q[2]=Q[3]=0;Q.writeUIntBE(f,4,6)}Q[1]|=128;for(let i=0;i<f;++i){Q[C+i]=A[i]^p[i&3]}return Q}}i.exports={WebsocketFrameSend:WebsocketFrameSend}},9469:(i,A,p)=>{"use strict";const{createInflateRaw:g,Z_DEFAULT_WINDOWBITS:f}=p(8522);const{isValidClientWindowBits:E}=p(8625);const C=Buffer.from([0,0,255,255]);const Q=Symbol("kBuffer");const B=Symbol("kLength");class PerMessageDeflate{#Z;#h={};constructor(i){this.#h.serverNoContextTakeover=i.has("server_no_context_takeover");this.#h.serverMaxWindowBits=i.get("server_max_window_bits")}decompress(i,A,p){if(!this.#Z){let i=f;if(this.#h.serverMaxWindowBits){if(!E(this.#h.serverMaxWindowBits)){p(new Error("Invalid server_max_window_bits"));return}i=Number.parseInt(this.#h.serverMaxWindowBits)}this.#Z=g({windowBits:i});this.#Z[Q]=[];this.#Z[B]=0;this.#Z.on("data",(i=>{this.#Z[Q].push(i);this.#Z[B]+=i.length}));this.#Z.on("error",(i=>{this.#Z=null;p(i)}))}this.#Z.write(i);if(A){this.#Z.write(C)}this.#Z.flush((()=>{const i=Buffer.concat(this.#Z[Q],this.#Z[B]);this.#Z[Q].length=0;this.#Z[B]=0;p(null,i)}))}}i.exports={PerMessageDeflate:PerMessageDeflate}},1652:(i,A,p)=>{"use strict";const{Writable:g}=p(7075);const f=p(4589);const{parserStates:E,opcodes:C,states:Q,emptyBuffer:B,sentCloseFrameState:I}=p(736);const{kReadyState:y,kSentClose:w,kResponse:v,kReceivedClose:x}=p(1216);const{channels:k}=p(2414);const{isValidStatusCode:S,isValidOpcode:D,failWebsocketConnection:N,websocketMessageReceived:T,utf8Decode:M,isControlFrame:U,isTextBinaryFrame:L,isContinuationFrame:_}=p(8625);const{WebsocketFrameSend:O}=p(3264);const{closeWebSocketConnection:G}=p(6897);const{PerMessageDeflate:H}=p(9469);class ByteParser extends g{#K=[];#X=0;#$=false;#Q=E.INFO;#ee={};#te=[];#se;constructor(i,A){super();this.ws=i;this.#se=A==null?new Map:A;if(this.#se.has("permessage-deflate")){this.#se.set("permessage-deflate",new H(A))}}_write(i,A,p){this.#K.push(i);this.#X+=i.length;this.#$=true;this.run(p)}run(i){while(this.#$){if(this.#Q===E.INFO){if(this.#X<2){return i()}const A=this.consume(2);const p=(A[0]&128)!==0;const g=A[0]&15;const f=(A[1]&128)===128;const Q=!p&&g!==C.CONTINUATION;const B=A[1]&127;const I=A[0]&64;const y=A[0]&32;const w=A[0]&16;if(!D(g)){N(this.ws,"Invalid opcode received");return i()}if(f){N(this.ws,"Frame cannot be masked");return i()}if(I!==0&&!this.#se.has("permessage-deflate")){N(this.ws,"Expected RSV1 to be clear.");return}if(y!==0||w!==0){N(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(Q&&!L(g)){N(this.ws,"Invalid frame type was fragmented.");return}if(L(g)&&this.#te.length>0){N(this.ws,"Expected continuation frame");return}if(this.#ee.fragmented&&Q){N(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((B>125||Q)&&U(g)){N(this.ws,"Control frame either too large or fragmented");return}if(_(g)&&this.#te.length===0&&!this.#ee.compressed){N(this.ws,"Unexpected continuation frame");return}if(B<=125){this.#ee.payloadLength=B;this.#Q=E.READ_DATA}else if(B===126){this.#Q=E.PAYLOADLENGTH_16}else if(B===127){this.#Q=E.PAYLOADLENGTH_64}if(L(g)){this.#ee.binaryType=g;this.#ee.compressed=I!==0}this.#ee.opcode=g;this.#ee.masked=f;this.#ee.fin=p;this.#ee.fragmented=Q}else if(this.#Q===E.PAYLOADLENGTH_16){if(this.#X<2){return i()}const A=this.consume(2);this.#ee.payloadLength=A.readUInt16BE(0);this.#Q=E.READ_DATA}else if(this.#Q===E.PAYLOADLENGTH_64){if(this.#X<8){return i()}const A=this.consume(8);const p=A.readUInt32BE(0);if(p>2**31-1){N(this.ws,"Received payload length > 2^31 bytes.");return}const g=A.readUInt32BE(4);this.#ee.payloadLength=(p<<8)+g;this.#Q=E.READ_DATA}else if(this.#Q===E.READ_DATA){if(this.#X<this.#ee.payloadLength){return i()}const A=this.consume(this.#ee.payloadLength);if(U(this.#ee.opcode)){this.#$=this.parseControlFrame(A);this.#Q=E.INFO}else{if(!this.#ee.compressed){this.#te.push(A);if(!this.#ee.fragmented&&this.#ee.fin){const i=Buffer.concat(this.#te);T(this.ws,this.#ee.binaryType,i);this.#te.length=0}this.#Q=E.INFO}else{this.#se.get("permessage-deflate").decompress(A,this.#ee.fin,((A,p)=>{if(A){G(this.ws,1007,A.message,A.message.length);return}this.#te.push(p);if(!this.#ee.fin){this.#Q=E.INFO;this.#$=true;this.run(i);return}T(this.ws,this.#ee.binaryType,Buffer.concat(this.#te));this.#$=true;this.#Q=E.INFO;this.#te.length=0;this.run(i)}));this.#$=false;break}}}}}consume(i){if(i>this.#X){throw new Error("Called consume() before buffers satiated.")}else if(i===0){return B}if(this.#K[0].length===i){this.#X-=this.#K[0].length;return this.#K.shift()}const A=Buffer.allocUnsafe(i);let p=0;while(p!==i){const g=this.#K[0];const{length:f}=g;if(f+p===i){A.set(this.#K.shift(),p);break}else if(f+p>i){A.set(g.subarray(0,i-p),p);this.#K[0]=g.subarray(i-p);break}else{A.set(this.#K.shift(),p);p+=g.length}}this.#X-=i;return A}parseCloseBody(i){f(i.length!==1);let A;if(i.length>=2){A=i.readUInt16BE(0)}if(Line truncated
*/var p=u(9829);var g=u(6928).extname;var E=/^\s*([^;\s]*)(?:;|\s|$)/;var C=/^text\//i;A.charset=charset;A.charsets={lookup:charset};A.contentType=contentType;A.extension=extension;A.extensions=Object.create(null);A.lookup=lookup;A.types=Object.create(null);populateMaps(A.extensions,A.types);function charset(i){if(!i||typeof i!=="string"){return false}var A=E.exec(i);var u=A&&p[A[1].toLowerCase()];if(u&&u.charset){return u.charset}if(A&&C.test(A[1])){return"UTF-8"}return false}function contentType(i){if(!i||typeof i!=="string"){return false}var u=i.indexOf("/")===-1?A.lookup(i):i;if(!u){return false}if(u.indexOf("charset")===-1){var p=A.charset(u);if(p)u+="; charset="+p.toLowerCase()}return u}function extension(i){if(!i||typeof i!=="string"){return false}var u=E.exec(i);var p=u&&A.extensions[u[1].toLowerCase()];if(!p||!p.length){return false}return p[0]}function lookup(i){if(!i||typeof i!=="string"){return false}var u=g("x."+i).toLowerCase().substr(1);if(!u){return false}return A.types[u]||false}function populateMaps(i,A){var u=["nginx","apache",undefined,"iana"];Object.keys(p).forEach((function forEachMimeType(g){var E=p[g];var C=E.extensions;if(!C||!C.length){return}i[g]=C;for(var Q=0;Q<C.length;Q++){var B=C[Q];if(A[B]){var I=u.indexOf(p[A[B]].source);var y=u.indexOf(E.source);if(A[B]!=="application/octet-stream"&&(I>y||I===y&&A[B].substr(0,12)==="application/")){continue}}A[B]=g}}))}},744:i=>{var A=1e3;var u=A*60;var p=u*60;var g=p*24;var E=g*7;var C=g*365.25;i.exports=function(i,A){A=A||{};var u=typeof i;if(u==="string"&&i.length>0){return parse(i)}else if(u==="number"&&isFinite(i)){return A.long?fmtLong(i):fmtShort(i)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function parse(i){i=String(i);if(i.length>100){return}var Q=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!Q){return}var B=parseFloat(Q[1]);var I=(Q[2]||"ms").toLowerCase();switch(I){case"years":case"year":case"yrs":case"yr":case"y":return B*C;case"weeks":case"week":case"w":return B*E;case"days":case"day":case"d":return B*g;case"hours":case"hour":case"hrs":case"hr":case"h":return B*p;case"minutes":case"minute":case"mins":case"min":case"m":return B*u;case"seconds":case"second":case"secs":case"sec":case"s":return B*A;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return B;default:return undefined}}function fmtShort(i){var E=Math.abs(i);if(E>=g){return Math.round(i/g)+"d"}if(E>=p){return Math.round(i/p)+"h"}if(E>=u){return Math.round(i/u)+"m"}if(E>=A){return Math.round(i/A)+"s"}return i+"ms"}function fmtLong(i){var E=Math.abs(i);if(E>=g){return plural(i,E,g,"day")}if(E>=p){return plural(i,E,p,"hour")}if(E>=u){return plural(i,E,u,"minute")}if(E>=A){return plural(i,E,A,"second")}return i+" ms"}function plural(i,A,u,p){var g=A>=u*1.5;return Math.round(i/u)+" "+p+(g?"s":"")}},7777:(i,A,u)=>{"use strict";var p=u(7016).parse;var g={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var E=String.prototype.endsWith||function(i){return i.length<=this.length&&this.indexOf(i,this.length-i.length)!==-1};function getProxyForUrl(i){var A=typeof i==="string"?p(i):i||{};var u=A.protocol;var E=A.host;var C=A.port;if(typeof E!=="string"||!E||typeof u!=="string"){return""}u=u.split(":",1)[0];E=E.replace(/:\d*$/,"");C=parseInt(C)||g[u]||0;if(!shouldProxy(E,C)){return""}var Q=getEnv("npm_config_"+u+"_proxy")||getEnv(u+"_proxy")||getEnv("npm_config_proxy")||getEnv("all_proxy");if(Q&&Q.indexOf("://")===-1){Q=u+"://"+Q}return Q}function shouldProxy(i,A){var u=(getEnv("npm_config_no_proxy")||getEnv("no_proxy")).toLowerCase();if(!u){return true}if(u==="*"){return false}return u.split(/[,\s]/).every((function(u){if(!u){return true}var p=u.match(/^(.+):(\d+)$/);var g=p?p[1]:u;var C=p?parseInt(p[2]):0;if(C&&C!==A){return true}if(!/^[.*]/.test(g)){return i!==g}if(g.charAt(0)==="*"){g=g.slice(1)}return!E.call(i,g)}))}function getEnv(i){return process.env[i.toLowerCase()]||process.env[i.toUpperCase()]||""}A.T=getProxyForUrl},9546:(i,A,u)=>{"use strict";Object.defineProperty(A,"__esModule",{value:true});const p=u(1354);const g=u(7016);const E=u(4434);const C=u(2830);const Q=u(3106);const B=u(4922);const I=u(9023);const y=u(9896);const w=u(9557);const v=u(6928);function _interopDefaultLegacy(i){return i&&typeof i==="object"&&"default"in i?i:{default:i}}const x=_interopDefaultLegacy(p);const k=_interopDefaultLegacy(g);const S=_interopDefaultLegacy(C);const D=_interopDefaultLegacy(Q);const N=_interopDefaultLegacy(B);const T=_interopDefaultLegacy(I);const M=_interopDefaultLegacy(y);const U=_interopDefaultLegacy(w);const L=_interopDefaultLegacy(v);const _=S["default"]("screepsapi:socket");const O={reconnect:true,resubscribe:true,keepAlive:true,maxRetries:10,maxRetryDelay:60*1e3};class Socket extends E.EventEmitter{constructor(i){super();this.api=i;this.opts=Object.assign({},O);this.on("error",(()=>{}));this.reset();this.oLine truncated
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=i=>i.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=i=>i.replace(/\r?\n|\r/g,"\r\n");const p=[];const g=new Uint8Array([13,10]);y=0;let E=false;for(const[A,C]of i){if(typeof C==="string"){const i=O.encode(u+`; name="${escape(normalizeLinefeeds(A))}"`+`\r\n\r\n${normalizeLinefeeds(C)}\r\n`);p.push(i);y+=i.byteLength}else{const i=O.encode(`${u}; name="${escape(normalizeLinefeeds(A))}"`+(C.name?`; filename="${escape(C.name)}"`:"")+"\r\n"+`Content-Type: ${C.type||"application/octet-stream"}\r\n\r\n`);p.push(i,C,g);if(typeof C.size==="number"){y+=i.byteLength+C.size+g.byteLength}else{E=true}}}const C=O.encode(`--${A}--\r\n`);p.push(C);y+=C.byteLength;if(E){y=null}I=i;B=async function*(){for(const i of p){if(i.stream){yield*i.stream()}else{yield i}}};w=`multipart/form-data; boundary=${A}`}else if(E(i)){I=i;y=i.size;if(i.type){w=i.type}}else if(typeof i[Symbol.asyncIterator]==="function"){if(A){throw new TypeError("keepalive")}if(p.isDisturbed(i)||i.locked){throw new TypeError("Response body object should not be disturbed or locked")}u=i instanceof ReadableStream?i:g(i)}if(typeof I==="string"||p.isBuffer(I)){y=Buffer.byteLength(I)}if(B!=null){let A;u=new ReadableStream({async start(){A=B(i)[Symbol.asyncIterator]()},async pull(i){const{value:p,done:g}=await A.next();if(g){queueMicrotask((()=>{i.close();i.byobRequest?.respond(0)}))}else{if(!N(u)){const A=new Uint8Array(p);if(A.byteLength){i.enqueue(A)}}}return i.desiredSize>0},async cancel(i){await A.return()},type:"bytes"})}const v={stream:u,source:I,length:y};return[v,w]}function safelyExtractBody(i,A=false){if(i instanceof ReadableStream){D(!p.isDisturbed(i),"The body has already been consumed.");D(!i.locked,"The stream is locked.")}return extractBody(i,A)}function cloneBody(i,A){const[u,p]=A.stream.tee();A.stream=u;return{stream:p,length:A.length,source:A.source}}function throwIfAborted(i){if(i.aborted){throw new DOMException("The operation was aborted.","AbortError")}}function bodyMixinMethods(i){const A={blob(){return consumeBody(this,(i=>{let A=bodyMimeType(this);if(A===null){A=""}else if(A){A=U(A)}return new S([i],{type:A})}),i)},arrayBuffer(){return consumeBody(this,(i=>new Uint8Array(i).buffer),i)},text(){return consumeBody(this,w,i)},json(){return consumeBody(this,parseJSONFromBytes,i)},formData(){return consumeBody(this,(i=>{const A=bodyMimeType(this);if(A!==null){switch(A.essence){case"multipart/form-data":{const u=L(i,A);if(u==="failure"){throw new TypeError("Failed to parse body as FormData.")}const p=new v;p[x]=u;return p}case"application/x-www-form-urlencoded":{const A=new URLSearchParams(i.toString());const u=new v;for(const[i,p]of A){u.append(i,p)}return u}}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')}),i)},bytes(){return consumeBody(this,(i=>new Uint8Array(i)),i)}};return A}function mixinBody(i){Object.assign(i.prototype,bodyMixinMethods(i))}async function consumeBody(i,A,u){k.brandCheck(i,u);if(bodyUnusable(i)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(i[x]);const p=B();const errorSteps=i=>p.reject(i);const successSteps=i=>{try{p.resolve(A(i))}catch(i){errorSteps(i)}};if(i[x].body==null){successSteps(Buffer.allocUnsafe(0));return p.promise}await I(i[x].body,successSteps,errorSteps);return p.promise}function bodyUnusable(i){const A=i[x].body;return A!=null&&(A.stream.locked||p.isDisturbed(A.stream))}function parseJSONFromBytes(i){return JSON.parse(w(i))}function bodyMimeType(i){const A=i[x].headersList;const u=y(A);if(u==="failure"){return null}return u}i.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:H,hasFinalizationRegistry:G,bodyUnusable:bodyUnusable}},4495:i=>{"use strict";const A=["GET","HEAD","POST"];const u=new Set(A);const p=[101,204,205,304];const g=[301,302,303,307,308];const E=new Set(g);const C=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"];const Q=new Set(C);const B=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"];const I=new Set(B);const y=["follow","manual","error"];const w=["GET","HEAD","OPTIONS","TRACE"];const v=new Set(w);const x=["navigate","same-origin","no-cors","cors"];const k=["omit","same-origin","include"];const S=["default","no-store","reload","no-caLine truncated
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */Q[C-4]=u[0];Q[C-3]=u[1];Q[C-2]=u[2];Q[C-1]=u[3];Q[1]=E;if(E===126){Q.writeUInt16BE(g,2)}else if(E===127){Q[2]=Q[3]=0;Q.writeUIntBE(g,4,6)}Q[1]|=128;for(let i=0;i<g;++i){Q[C+i]=A[i]^u[i&3]}return Q}}i.exports={WebsocketFrameSend:WebsocketFrameSend}},9469:(i,A,u)=>{"use strict";const{createInflateRaw:p,Z_DEFAULT_WINDOWBITS:g}=u(8522);const{isValidClientWindowBits:E}=u(8625);const C=Buffer.from([0,0,255,255]);const Q=Symbol("kBuffer");const B=Symbol("kLength");class PerMessageDeflate{#Z;#h={};constructor(i){this.#h.serverNoContextTakeover=i.has("server_no_context_takeover");this.#h.serverMaxWindowBits=i.get("server_max_window_bits")}decompress(i,A,u){if(!this.#Z){let i=g;if(this.#h.serverMaxWindowBits){if(!E(this.#h.serverMaxWindowBits)){u(new Error("Invalid server_max_window_bits"));return}i=Number.parseInt(this.#h.serverMaxWindowBits)}this.#Z=p({windowBits:i});this.#Z[Q]=[];this.#Z[B]=0;this.#Z.on("data",(i=>{this.#Z[Q].push(i);this.#Z[B]+=i.length}));this.#Z.on("error",(i=>{this.#Z=null;u(i)}))}this.#Z.write(i);if(A){this.#Z.write(C)}this.#Z.flush((()=>{const i=Buffer.concat(this.#Z[Q],this.#Z[B]);this.#Z[Q].length=0;this.#Z[B]=0;u(null,i)}))}}i.exports={PerMessageDeflate:PerMessageDeflate}},1652:(i,A,u)=>{"use strict";const{Writable:p}=u(7075);const g=u(4589);const{parserStates:E,opcodes:C,states:Q,emptyBuffer:B,sentCloseFrameState:I}=u(736);const{kReadyState:y,kSentClose:w,kResponse:v,kReceivedClose:x}=u(1216);const{channels:k}=u(2414);const{isValidStatusCode:S,isValidOpcode:D,failWebsocketConnection:N,websocketMessageReceived:T,utf8Decode:M,isControlFrame:U,isTextBinaryFrame:L,isContinuationFrame:_}=u(8625);const{WebsocketFrameSend:O}=u(3264);const{closeWebSocketConnection:G}=u(6897);const{PerMessageDeflate:H}=u(9469);class ByteParser extends p{#K=[];#X=0;#$=false;#Q=E.INFO;#ee={};#te=[];#se;constructor(i,A){super();this.ws=i;this.#se=A==null?new Map:A;if(this.#se.has("permessage-deflate")){this.#se.set("permessage-deflate",new H(A))}}_write(i,A,u){this.#K.push(i);this.#X+=i.length;this.#$=true;this.run(u)}run(i){while(this.#$){if(this.#Q===E.INFO){if(this.#X<2){return i()}const A=this.consume(2);const u=(A[0]&128)!==0;const p=A[0]&15;const g=(A[1]&128)===128;const Q=!u&&p!==C.CONTINUATION;const B=A[1]&127;const I=A[0]&64;const y=A[0]&32;const w=A[0]&16;if(!D(p)){N(this.ws,"Invalid opcode received");return i()}if(g){N(this.ws,"Frame cannot be masked");return i()}if(I!==0&&!this.#se.has("permessage-deflate")){N(this.ws,"Expected RSV1 to be clear.");return}if(y!==0||w!==0){N(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(Q&&!L(p)){N(this.ws,"Invalid frame type was fragmented.");return}if(L(p)&&this.#te.length>0){N(this.ws,"Expected continuation frame");return}if(this.#ee.fragmented&&Q){N(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((B>125||Q)&&U(p)){N(this.ws,"Control frame either too large or fragmented");return}if(_(p)&&this.#te.length===0&&!this.#ee.compressed){N(this.ws,"Unexpected continuation frame");return}if(B<=125){this.#ee.payloadLength=B;this.#Q=E.READ_DATA}else if(B===126){this.#Q=E.PAYLOADLENGTH_16}else if(B===127){this.#Q=E.PAYLOADLENGTH_64}if(L(p)){this.#ee.binaryType=p;this.#ee.compressed=I!==0}this.#ee.opcode=p;this.#ee.masked=g;this.#ee.fin=u;this.#ee.fragmented=Q}else if(this.#Q===E.PAYLOADLENGTH_16){if(this.#X<2){return i()}const A=this.consume(2);this.#ee.payloadLength=A.readUInt16BE(0);this.#Q=E.READ_DATA}else if(this.#Q===E.PAYLOADLENGTH_64){if(this.#X<8){return i()}const A=this.consume(8);const u=A.readUInt32BE(0);if(u>2**31-1){N(this.ws,"Received payload length > 2^31 bytes.");return}const p=A.readUInt32BE(4);this.#ee.payloadLength=(u<<8)+p;this.#Q=E.READ_DATA}else if(this.#Q===E.READ_DATA){if(this.#X<this.#ee.payloadLength){return i()}const A=this.consume(this.#ee.payloadLength);if(U(this.#ee.opcode)){this.#$=this.parseControlFrame(A);this.#Q=E.INFO}else{if(!this.#ee.compressed){this.#te.push(A);if(!this.#ee.fragmented&&this.#ee.fin){const i=Buffer.concat(this.#te);T(this.ws,this.#ee.binaryType,i);this.#te.length=0}this.#Q=E.INFO}else{this.#se.get("permessage-deflate").decompress(A,this.#ee.fin,((A,u)=>{if(A){G(this.ws,1007,A.message,A.message.length);return}this.#te.push(u);if(!this.#ee.fin){this.#Q=E.INFO;this.#$=true;this.run(i);return}T(this.ws,this.#ee.binaryType,Buffer.concat(this.#te));this.#$=true;this.#Q=E.INFO;this.#te.length=0;this.run(i)}));this.#$=false;break}}}}}consume(i){if(i>this.#X){throw new Error("Called consume() before buffers satiated.")}else if(i===0){return B}if(this.#K[0].length===i){this.#X-=this.#K[0].length;return this.#K.shift()}const A=Buffer.allocUnsafe(i);let u=0;while(u!==i){const p=this.#K[0];const{length:g}=p;if(g+u===i){A.set(this.#K.shift(),u);break}else if(g+u>i){A.set(p.subarray(0,i-u),u);this.#K[0]=p.subarray(i-u);break}else{A.set(this.#K.shift(),u);u+=p.length}}this.#X-=i;return A}parseCloseBody(i){g(i.length!==1);let A;if(i.length>=2){A=i.readUInt16BE(0)}if(Line truncated
+7 -7
View File
@@ -1530,12 +1530,12 @@
}
},
"node_modules/glob": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-13.0.3.tgz",
"integrity": "sha512-/g3B0mC+4x724v1TgtBlBtt2hPi/EWptsIAmXUx9Z2rvBYleQcsrmaOzd5LyL50jf/Soi83ZDJmw2+XqvH/EeA==",
"version": "13.0.5",
"resolved": "https://registry.npmjs.org/glob/-/glob-13.0.5.tgz",
"integrity": "sha512-BzXxZg24Ibra1pbQ/zE7Kys4Ua1ks7Bn6pKLkVPZ9FZe4JQS6/Q7ef3LG1H+k7lUf5l4T3PLSyYyYJVYUvfgTw==",
"license": "BlueOak-1.0.0",
"dependencies": {
"minimatch": "^10.2.0",
"minimatch": "^10.2.1",
"minipass": "^7.1.2",
"path-scurry": "^2.0.0"
},
@@ -1770,9 +1770,9 @@
}
},
"node_modules/minimatch": {
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.0.tgz",
"integrity": "sha512-ugkC31VaVg9cF0DFVoADH12k6061zNZkZON+aX8AWsR9GhPcErkcMBceb6znR8wLERM2AkkOxy2nWRLpT9Jq5w==",
"version": "10.2.1",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.1.tgz",
"integrity": "sha512-MClCe8IL5nRRmawL6ib/eT4oLyeKMGCghibcDWK+J0hh0Q8kqSdia6BvbRMVk6mPa6WqUa5uR2oxt6C5jd533A==",
"license": "BlueOak-1.0.0",
"dependencies": {
"brace-expansion": "^5.0.2"