node_modules ignore

This commit is contained in:
oier committed 2025-05-08 23:43:47 +02:00
1 parent e19d52f172
commit 4574544c9f
65041 files changed
+10593536

No files matched your search

+1
View File
@@ -0,0 +1 @@
"use strict";const e=!(typeof navigator>"u")&&"ReactNative"===navigator.product,t={timeout:e?6e4:12e4};function r(e){return decodeURIComponent(e.replace(/\+/g," "))}function o(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;const r=Number(e);return isNaN(r)?o(t.timeout):{connect:r,socket:r}}const n=/^https?:\/\//i;exports.g=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e},exports.p=function(n){const s={...t,..."string"==typeof n?{url:n}:n};if(s.timeout=o(s.timeout),s.query){const{url:t,searchParams:o}=function(t){const o=t.indexOf("?");if(-1===o)return{url:t,searchParams:new URLSearchParams};const n=t.slice(0,o),s=t.slice(o+1);if(!e)return{url:n,searchParams:new URLSearchParams(s)};if("function"!=typeof decodeURIComponent)throw new Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");const a=new URLSearchParams;for(const e of s.split("&")){const[t,o]=e.split("=");t&&a.append(r(t),r(o||""))}return{url:n,searchParams:a}}(s.url);for(const[e,r]of Object.entries(s.query)){if(void 0!==r)if(Array.isArray(r))for(const t of r)o.append(e,t);else o.append(e,r);const n=o.toString();n&&(s.url=`${t}?${n}`)}}return s.method=s.body&&!s.method?"POST":(s.method||"GET").toUpperCase(),s},exports.v=function(e){if(!n.test(e.url))throw new Error(`"${e.url}" is not a valid URL`)};//# sourceMappingURL=_commonjsHelpers.cjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"_commonjsHelpers.cjs","sources":["../../src/middleware/defaultOptionsProcessor.ts","../../src/middleware/defaultOptionsValidator.ts"],"sourcesContent":["import type {MiddlewareHooks, RequestOptions} from 'get-it'\n\nconst isReactNative = typeof navigator === 'undefined' ? false : navigator.product === 'ReactNative'\n\nconst defaultOptions = {timeout: isReactNative ? 60000 : 120000} satisfies Partial<RequestOptions>\n\n/** @public */\nexport const processOptions = function processOptions(opts) {\n const options = {\n ...defaultOptions,\n ...(typeof opts === 'string' ? {url: opts} : opts),\n } satisfies RequestOptions\n\n // Normalize timeouts\n options.timeout = normalizeTimeout(options.timeout)\n\n // Shallow-merge (override) existing query params\n if (options.query) {\n const {url, searchParams} = splitUrl(options.url)\n\n for (const [key, value] of Object.entries(options.query)) {\n if (value !== undefined) {\n if (Array.isArray(value)) {\n for (const v of value) {\n searchParams.append(key, v as string)\n }\n } else {\n searchParams.append(key, value as string)\n }\n }\n\n // Merge back params into url\n const search = searchParams.toString()\n if (search) {\n options.url = `${url}?${search}`\n }\n }\n }\n\n // Implicit POST if we have not specified a method but have a body\n options.method =\n options.body && !options.method ? 'POST' : (options.method || 'GET').toUpperCase()\n\n return options\n} satisfies MiddlewareHooks['processOptions']\n\n/**\n * Given a string URL, extracts the query string and URL from each other, and returns them.\n * Note that we cannot use the `URL` constructor because of old React Native versions which are\n * majorly broken and returns incorrect results:\n *\n * (`new URL('http://foo/?a=b').toString()` == 'http://foo/?a=b/')\n */\nfunction splitUrl(url: string): {url: string; searchParams: URLSearchParams} {\n const qIndex = url.indexOf('?')\n if (qIndex === -1) {\n return {url, searchParams: new URLSearchParams()}\n }\n\n const base = url.slice(0, qIndex)\n const qs = url.slice(qIndex + 1)\n\n // React Native's URL and URLSearchParams are broken, so passing a string to URLSearchParams\n // does not work, leading to an empty query string. For other environments, this should be enough\n if (!isReactNative) {\n return {url: base, searchParams: new URLSearchParams(qs)}\n }\n\n // Sanity-check; we do not know of any environment where this is the case,\n // but if it is, we should not proceed without giving a descriptive error\n if (typeof decodeURIComponent !== 'function') {\n throw new Error(\n 'Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined',\n )\n }\n\n const params = new URLSearchParams()\n for (const pair of qs.split('&')) {\n const [key, value] = pair.split('=')\n if (key) {\n params.append(decodeQueryParam(key), decodeQueryParam(value || ''))\n }\n }\n\n return {url: base, searchParams: params}\n}\n\nfunction decodeQueryParam(value: string): string {\n return decodeURIComponent(value.replace(/\\+/g, ' '))\n}\n\nfunction normalizeTimeout(time: RequestOptions['timeout']) {\n if (time === false || time === 0) {\n return false\n }\n\n if (time.connect || time.socket) {\n return time\n }\n\n const delay = Number(time)\n if (isNaN(delay)) {\n return normalizeTimeout(defaultOptions.timeout)\n }\n\n return {connect: delay, socket: delay}\n}\n","import type {MiddlewareHooks} from 'get-it'\n\nconst validUrl = /^https?:\\/\\//i\n\n/** @public */\nexport const validateOptions = function validateOptions(options) {\n if (!validUrl.test(options.url)) {\n throw new Error(`\"${options.url}\" is not a valid URL`)\n }\n} satisfies MiddlewareHooks['validateOptions']\n"],"names":["isReactNative","navigator","product","defaultOptions","timeout","decodeQueryParam","value","decodeURIComponent","replace","normalizeTimeout","time","connect","socket","delay","Number","isNaN","validUrl","x","opts","options","url","query","searchParams","qIndex","indexOf","URLSearchParams","base","slice","qs","Error","params","pair","split","key","append","splitUrl","Object","entries","Array","isArray","v","search","toString","method","body","toUpperCase","test"],"mappings":"aAEA,MAAMA,WAAuBC,UAAc,MAA4C,gBAAtBA,UAAUC,QAErEC,EAAiB,CAACC,QAASJ,EAAgB,IAAQ,MAmFzD,SAASK,EAAiBC,GACxB,OAAOC,mBAAmBD,EAAME,QAAQ,MAAO,KACjD,CAEA,SAASC,EAAiBC,GACpB,IAAS,IAATA,GAA2B,IAATA,EACb,OAAA,EAGL,GAAAA,EAAKC,SAAWD,EAAKE,OAChB,OAAAF,EAGH,MAAAG,EAAQC,OAAOJ,GACjB,OAAAK,MAAMF,GACDJ,EAAiBN,EAAeC,SAGlC,CAACO,QAASE,EAAOD,OAAQC,EAClC,CCxGA,MAAMG,EAAW,0BAOjB,SAAAC,oGDF8B,SAAwBC,GACpD,MAAMC,EAAU,IACXhB,KACiB,iBAATe,EAAoB,CAACE,IAAKF,GAAQA,GAO/C,GAHAC,EAAQf,QAAUK,EAAiBU,EAAQf,SAGvCe,EAAQE,MAAO,CACjB,MAAMD,IAACA,EAAKE,aAAAA,GAmChB,SAAkBF,GACV,MAAAG,EAASH,EAAII,QAAQ,KAC3B,IAAe,IAAXD,EACF,MAAO,CAACH,MAAKE,aLine truncated
+1
View File
@@ -0,0 +1 @@
"use strict";var e=require("decompress-response"),t=require("follow-redirects"),o=require("http"),r=require("https"),n=require("querystring"),s=require("stream"),a=require("url"),c=require("through2"),u=require("tunnel-agent");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function p(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=/* @__PURE__ */Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var d=/* @__PURE__ */i(e),l=/* @__PURE__ */i(t),h=/* @__PURE__ */i(o),f=/* @__PURE__ */i(r),m=/* @__PURE__ */i(n),g=/* @__PURE__ */i(a),y=/* @__PURE__ */i(c),b=/* @__PURE__ */p(u);const x=!(typeof navigator>"u")&&"ReactNative"===navigator.product,w={timeout:x?6e4:12e4};function O(e){return decodeURIComponent(e.replace(/\+/g," "))}function v(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;const t=Number(e);return isNaN(t)?v(w.timeout):{connect:t,socket:t}}const R=/^https?:\/\//i;function q(e){return Object.keys(e||{}).reduce(((t,o)=>(t[o.toLowerCase()]=e[o],t)),{})}let P=1;const T=65535;let j=null;const S=function(){P=P+1&T};function C(e){let t=e.length||0,o=0,r=Date.now()+e.time,n=0;const s=function(){j||(j=setInterval(S,250),j.unref&&j.unref());const e=[0];let t=1,o=P-1&T;return{getSpeed:function(r){let n=P-o&T;for(n>20&&(n=20),o=P;n--;)20===t&&(t=0),e[t]=e[0===t?19:t-1],t++;r&&(e[t-1]+=r);const s=e[t-1],a=e.length<20?0:e[20===t?0:t];return e.length<4?s:4*(s-a)/e.length},clear:function(){j&&(clearInterval(j),j=null)}}}(),a=Date.now(),c={percentage:0,transferred:o,length:t,remaining:t,eta:0,runtime:0,speed:0,delta:0},u=function(u){c.delta=n,c.percentage=u?100:t?o/t*100:0,c.speed=s.getSpeed(n),c.eta=Math.round(c.remaining/c.speed),c.runtime=Math.floor((Date.now()-a)/1e3),r=Date.now()+e.time,n=0,i.emit("progress",c)},i=y.default({},(function(e,s,a){const i=e.length;o+=i,n+=i,c.transferred=o,c.remaining=t>=o?t-o:0,Date.now()>=r&&u(!1),a(null,e)}),(function(e){u(!0),s.clear(),e()})),p=function(e){t=e,c.length=t,c.remaining=t-c.transferred,i.emit("length",t)};return i.on("pipe",(function(e){if(!(t>0)){if(e.readable&&!("writable"in e)&&"headers"in e&&"object"==typeof(o=e.headers)&&null!==o&&!Array.isArray(o)){const t="string"==typeof e.headers["content-length"]?parseInt(e.headers["content-length"],10):0;return p(t)}if("length"in e&&"number"==typeof e.length)return p(e.length);e.on("response",(function(e){if(e&&e.headers&&"gzip"!==e.headers["content-encoding"]&&e.headers["content-length"])return p(parseInt(e.headers["content-length"]))}))}var o})),i.progress=function(){return c.speed=s.getSpeed(0),c.eta=Math.round(c.remaining/c.speed),c},i}function L(e){return e.replace(/^\.*/,".").toLowerCase()}function E(e){const t=e.trim().toLowerCase(),o=t.split(":",2);return{hostname:L(o[0]),port:o[1],hasPort:t.indexOf(":")>-1}}const $=["protocol","slashes","auth","host","port","hostname","hash","search","query","pathname","path","href"],k=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],M=["proxy-authorization"],U=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe,z="node";class B extends Error{request;code;constructor(e,t){super(e.message),this.request=t,this.code=e.code}}const I=(e,t,o,r)=>({body:r,url:t,method:o,headers:e.headers,statusCode:e.statusCode,statusMessage:e.statusMessage});exports.N=B,exports.a=z,exports.b=C,exports.h=(e,t)=>{const{options:o}=e,r=Object.assign({},g.default.parse(o.url));if("function"==typeof fetch&&o.fetch){const n=new AbortController,s=e.applyMiddleware("finalizeOptions",{...r,method:o.method,headers:{..."object"==typeof o.fetch&&o.fetch.headers?q(o.fetch.headers):{},...q(o.headers)},maxRedirects:o.maxRedirects}),a={credentials:o.withCredentials?"include":"omit",..."object"==typeof o.fetch?o.fetch:{},method:s.method,headers:s.headers,body:o.body,signal:n.signal},c=e.applyMiddleware("interceptRequest",void 0,{adapter:z,context:e});if(c){const e=setTimeout(t,0,null,c);return{abort:()=>clearTimeout(e)}}const u=fetch(o.url,a);return e.applyMiddleware("onRequest",{options:o,adapter:z,request:u,context:e}),u.then((async e=>{const r=o.rawBody?e.body:await e.text(),n={};e.headers.forEach(((e,t)=>{n[t]=e})),t(null,{body:r,url:e.url,method:o.method,headers:n,statusCode:e.status,statusMessage:e.statusText})})).catch((e=>{"AbortError"!=e.name&&t(e)})),{abort:()=>n.abort()}}const n=U(o.body)?"stream":typeof o.body;if("undefined"!==n&&"stream"!==n&&"string"!==n&&!Buffer.isBuffer(o.body))throw new Error(`Request body must be a string, buffer or stream, got ${n}`);const a={};o.bodySize?a["content-length"]=o.bodySize:o.body&&"stream"!==n&&(a["conLine truncated
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"node-request.cjs","sources":["../../src/middleware/defaultOptionsProcessor.ts","../../src/middleware/defaultOptionsValidator.ts","../../src/util/lowerCaseHeaders.ts","../../src/util/speedometer.ts","../../src/util/progress-stream.ts","../../src/request/node/proxy.ts","../../src/request/node/tunnel.ts","../../src/request/node-request.ts","../../src/request/node/simpleConcat.ts","../../src/request/node/timedOut.ts"],"sourcesContent":["import type {MiddlewareHooks, RequestOptions} from 'get-it'\n\nconst isReactNative = typeof navigator === 'undefined' ? false : navigator.product === 'ReactNative'\n\nconst defaultOptions = {timeout: isReactNative ? 60000 : 120000} satisfies Partial<RequestOptions>\n\n/** @public */\nexport const processOptions = function processOptions(opts) {\n const options = {\n ...defaultOptions,\n ...(typeof opts === 'string' ? {url: opts} : opts),\n } satisfies RequestOptions\n\n // Normalize timeouts\n options.timeout = normalizeTimeout(options.timeout)\n\n // Shallow-merge (override) existing query params\n if (options.query) {\n const {url, searchParams} = splitUrl(options.url)\n\n for (const [key, value] of Object.entries(options.query)) {\n if (value !== undefined) {\n if (Array.isArray(value)) {\n for (const v of value) {\n searchParams.append(key, v as string)\n }\n } else {\n searchParams.append(key, value as string)\n }\n }\n\n // Merge back params into url\n const search = searchParams.toString()\n if (search) {\n options.url = `${url}?${search}`\n }\n }\n }\n\n // Implicit POST if we have not specified a method but have a body\n options.method =\n options.body && !options.method ? 'POST' : (options.method || 'GET').toUpperCase()\n\n return options\n} satisfies MiddlewareHooks['processOptions']\n\n/**\n * Given a string URL, extracts the query string and URL from each other, and returns them.\n * Note that we cannot use the `URL` constructor because of old React Native versions which are\n * majorly broken and returns incorrect results:\n *\n * (`new URL('http://foo/?a=b').toString()` == 'http://foo/?a=b/')\n */\nfunction splitUrl(url: string): {url: string; searchParams: URLSearchParams} {\n const qIndex = url.indexOf('?')\n if (qIndex === -1) {\n return {url, searchParams: new URLSearchParams()}\n }\n\n const base = url.slice(0, qIndex)\n const qs = url.slice(qIndex + 1)\n\n // React Native's URL and URLSearchParams are broken, so passing a string to URLSearchParams\n // does not work, leading to an empty query string. For other environments, this should be enough\n if (!isReactNative) {\n return {url: base, searchParams: new URLSearchParams(qs)}\n }\n\n // Sanity-check; we do not know of any environment where this is the case,\n // but if it is, we should not proceed without giving a descriptive error\n if (typeof decodeURIComponent !== 'function') {\n throw new Error(\n 'Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined',\n )\n }\n\n const params = new URLSearchParams()\n for (const pair of qs.split('&')) {\n const [key, value] = pair.split('=')\n if (key) {\n params.append(decodeQueryParam(key), decodeQueryParam(value || ''))\n }\n }\n\n return {url: base, searchParams: params}\n}\n\nfunction decodeQueryParam(value: string): string {\n return decodeURIComponent(value.replace(/\\+/g, ' '))\n}\n\nfunction normalizeTimeout(time: RequestOptions['timeout']) {\n if (time === false || time === 0) {\n return false\n }\n\n if (time.connect || time.socket) {\n return time\n }\n\n const delay = Number(time)\n if (isNaN(delay)) {\n return normalizeTimeout(defaultOptions.timeout)\n }\n\n return {connect: delay, socket: delay}\n}\n","import type {MiddlewareHooks} from 'get-it'\n\nconst validUrl = /^https?:\\/\\//i\n\n/** @public */\nexport const validateOptions = function validateOptions(options) {\n if (!validUrl.test(options.url)) {\n throw new Error(`\"${options.url}\" is not a valid URL`)\n }\n} satisfies MiddlewareHooks['validateOptions']\n","export function lowerCaseHeaders(headers: any) {\n return Object.keys(headers || {}).reduce((acc, header) => {\n acc[header.toLowerCase()] = headers[header]\n return acc\n }, {} as any)\n}\n","/**\n * Inlined variant of npm `speedometer` (https://github.com/mafintosh/speedometer),\n * MIT-licensed, Copyright (c) 2013 Mathias Buus.\n */\n\nlet tick = 1\nconst maxTick = 65535\nconst resolution = 4\nlet timer: ReturnType<typeof setInterval> | null = null\n\nconst inc = function () {\n tick = (tick + 1) & maxTick\n}\n\nexport function speedometer(seconds: number) {\n if (!timer) {\n timer = setInterval(inc, (1000 / resolution) | 0)\n if (timer.unref) timer.unref()\n }\n\n const size = resolution * (seconds || 5)\n const buffer = [0]\n let pointer = 1\n let last = (tick - 1) & maxTick\Line truncated