@stryke/http 0.12.25 → 0.12.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/_virtual/rolldown_runtime.cjs +29 -1
  3. package/dist/agent.cjs +96 -2
  4. package/dist/agent.mjs +93 -2
  5. package/dist/agent.mjs.map +1 -1
  6. package/dist/fetch.cjs +30 -1
  7. package/dist/fetch.mjs +28 -1
  8. package/dist/fetch.mjs.map +1 -1
  9. package/dist/format-data-uri.cjs +70 -1
  10. package/dist/format-data-uri.mjs +68 -1
  11. package/dist/format-data-uri.mjs.map +1 -1
  12. package/dist/get-free-port.cjs +23 -1
  13. package/dist/get-free-port.mjs +22 -1
  14. package/dist/get-free-port.mjs.map +1 -1
  15. package/dist/http-proxy.cjs +82 -3
  16. package/dist/http-proxy.mjs +79 -3
  17. package/dist/http-proxy.mjs.map +1 -1
  18. package/dist/https-proxy.cjs +106 -1
  19. package/dist/https-proxy.mjs +102 -1
  20. package/dist/https-proxy.mjs.map +1 -1
  21. package/dist/index.cjs +19 -1
  22. package/dist/index.mjs +10 -1
  23. package/dist/parse-response.cjs +83 -4
  24. package/dist/parse-response.mjs +82 -4
  25. package/dist/parse-response.mjs.map +1 -1
  26. package/dist/proxy-agent.cjs +18 -1
  27. package/dist/proxy-agent.mjs +18 -1
  28. package/dist/proxy-agent.mjs.map +1 -1
  29. package/dist/type-checks/src/index.cjs +10 -1
  30. package/dist/type-checks/src/index.mjs +12 -1
  31. package/dist/type-checks/src/is-boolean.cjs +18 -1
  32. package/dist/type-checks/src/is-boolean.mjs +17 -1
  33. package/dist/type-checks/src/is-boolean.mjs.map +1 -1
  34. package/dist/type-checks/src/is-buffer.cjs +12 -1
  35. package/dist/type-checks/src/is-buffer.mjs +11 -1
  36. package/dist/type-checks/src/is-buffer.mjs.map +1 -1
  37. package/dist/type-checks/src/is-collection.cjs +1 -1
  38. package/dist/type-checks/src/is-collection.mjs +3 -1
  39. package/dist/type-checks/src/is-empty.cjs +20 -1
  40. package/dist/type-checks/src/is-empty.mjs +20 -1
  41. package/dist/type-checks/src/is-empty.mjs.map +1 -1
  42. package/dist/type-checks/src/is-null.cjs +12 -1
  43. package/dist/type-checks/src/is-null.mjs +11 -1
  44. package/dist/type-checks/src/is-null.mjs.map +1 -1
  45. package/dist/type-checks/src/is-set-string.cjs +20 -1
  46. package/dist/type-checks/src/is-set-string.mjs +20 -1
  47. package/dist/type-checks/src/is-set-string.mjs.map +1 -1
  48. package/dist/type-checks/src/is-set.cjs +19 -1
  49. package/dist/type-checks/src/is-set.mjs +19 -1
  50. package/dist/type-checks/src/is-set.mjs.map +1 -1
  51. package/dist/type-checks/src/is-string.cjs +12 -1
  52. package/dist/type-checks/src/is-string.mjs +11 -1
  53. package/dist/type-checks/src/is-string.mjs.map +1 -1
  54. package/dist/type-checks/src/is-undefined.cjs +8 -1
  55. package/dist/type-checks/src/is-undefined.mjs +7 -1
  56. package/dist/type-checks/src/is-undefined.mjs.map +1 -1
  57. package/dist/type-checks/src/type-detect.cjs +15 -1
  58. package/dist/type-checks/src/type-detect.mjs +16 -1
  59. package/dist/type-checks/src/type-detect.mjs.map +1 -1
  60. package/dist/url/src/helpers.cjs +14 -1
  61. package/dist/url/src/helpers.mjs +13 -1
  62. package/dist/url/src/helpers.mjs.map +1 -1
  63. package/package.json +4 -4
@@ -1,5 +1,83 @@
1
- import{Buffer as e}from"node:buffer";async function t(t){return new Promise((n,r)=>{let i=0,a=[];function o(){let e=t.read();e?u(e):t.once(`readable`,o)}function s(){t.removeListener(`end`,c),t.removeListener(`error`,l),t.removeListener(`readable`,o)}function c(){s(),r(Error(`Proxy connection ended before receiving CONNECT response`))}function l(e){s(),r(e)}function u(c){a.push(c),i+=c.length;let l=e.concat(a,i),u=l.indexOf(`\r
2
- \r
3
- `);if(u===-1){o();return}let d=l.subarray(0,u).toString(`ascii`).split(`\r
4
- `),f=d.shift();if(!f)return t.destroy(),r(Error(`No header received from proxy CONNECT response`));let p=f.split(` `),m=+p[1],h=p.slice(2).join(` `),g={};for(let e of d){if(!e)continue;let n=e.indexOf(`:`);if(n===-1)return t.destroy(),r(Error(`Invalid header from proxy CONNECT response: "${e}"`));let i=e.slice(0,n).toLowerCase(),a=e.slice(n+1).trimStart(),o=g[i];typeof o==`string`?g[i]=[o,a]:Array.isArray(o)?o.push(a):g[i]=a}s(),n({connect:{statusCode:m,statusText:h,headers:g},buffered:l})}t.on(`error`,l),t.on(`end`,c),o()})}export{t as parseProxyResponse};
1
+ import { Buffer } from "node:buffer";
2
+
3
+ //#region src/parse-response.ts
4
+ /**
5
+ * Parses the proxy CONNECT response from the given socket.
6
+ *
7
+ * @param socket - The socket to read the response from.
8
+ * @returns A promise that resolves to the CONNECT response and any buffered data.
9
+ */
10
+ async function parseProxyResponse(socket) {
11
+ return new Promise((resolve, reject) => {
12
+ let buffersLength = 0;
13
+ const buffers = [];
14
+ function read() {
15
+ const b = socket.read();
16
+ if (b) ondata(b);
17
+ else socket.once("readable", read);
18
+ }
19
+ function cleanup() {
20
+ socket.removeListener("end", onend);
21
+ socket.removeListener("error", onerror);
22
+ socket.removeListener("readable", read);
23
+ }
24
+ function onend() {
25
+ cleanup();
26
+ reject(/* @__PURE__ */ new Error("Proxy connection ended before receiving CONNECT response"));
27
+ }
28
+ function onerror(err) {
29
+ cleanup();
30
+ reject(err);
31
+ }
32
+ function ondata(b) {
33
+ buffers.push(b);
34
+ buffersLength += b.length;
35
+ const buffered = Buffer.concat(buffers, buffersLength);
36
+ const endOfHeaders = buffered.indexOf("\r\n\r\n");
37
+ if (endOfHeaders === -1) {
38
+ read();
39
+ return;
40
+ }
41
+ const headerParts = buffered.subarray(0, endOfHeaders).toString("ascii").split("\r\n");
42
+ const firstLine = headerParts.shift();
43
+ if (!firstLine) {
44
+ socket.destroy();
45
+ return reject(/* @__PURE__ */ new Error("No header received from proxy CONNECT response"));
46
+ }
47
+ const firstLineParts = firstLine.split(" ");
48
+ const statusCode = +firstLineParts[1];
49
+ const statusText = firstLineParts.slice(2).join(" ");
50
+ const headers = {};
51
+ for (const header of headerParts) {
52
+ if (!header) continue;
53
+ const firstColon = header.indexOf(":");
54
+ if (firstColon === -1) {
55
+ socket.destroy();
56
+ return reject(/* @__PURE__ */ new Error(`Invalid header from proxy CONNECT response: "${header}"`));
57
+ }
58
+ const key = header.slice(0, firstColon).toLowerCase();
59
+ const value = header.slice(firstColon + 1).trimStart();
60
+ const current = headers[key];
61
+ if (typeof current === "string") headers[key] = [current, value];
62
+ else if (Array.isArray(current)) current.push(value);
63
+ else headers[key] = value;
64
+ }
65
+ cleanup();
66
+ resolve({
67
+ connect: {
68
+ statusCode,
69
+ statusText,
70
+ headers
71
+ },
72
+ buffered
73
+ });
74
+ }
75
+ socket.on("error", onerror);
76
+ socket.on("end", onend);
77
+ read();
78
+ });
79
+ }
80
+
81
+ //#endregion
82
+ export { parseProxyResponse };
5
83
  //# sourceMappingURL=parse-response.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-response.mjs","names":["buffers: Buffer[]","headers: IncomingHttpHeaders"],"sources":["../src/parse-response.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Buffer } from \"node:buffer\";\nimport type { IncomingHttpHeaders } from \"node:http\";\nimport type { Readable } from \"node:stream\";\n\nexport interface ConnectResponse {\n statusCode: number;\n statusText: string;\n headers: IncomingHttpHeaders;\n}\n\n/**\n * Parses the proxy CONNECT response from the given socket.\n *\n * @param socket - The socket to read the response from.\n * @returns A promise that resolves to the CONNECT response and any buffered data.\n */\nexport async function parseProxyResponse(\n socket: Readable\n): Promise<{ connect: ConnectResponse; buffered: Buffer }> {\n return new Promise((resolve, reject) => {\n // we need to buffer any HTTP traffic that happens with the proxy before we get\n // the CONNECT response, so that if the response is anything other than an \"200\"\n // response code, then we can re-play the \"data\" events on the socket once the\n // HTTP parser is hooked up...\n let buffersLength = 0;\n const buffers: Buffer[] = [];\n\n function read() {\n const b = socket.read();\n if (b) ondata(b);\n else socket.once(\"readable\", read);\n }\n\n function cleanup() {\n socket.removeListener(\"end\", onend);\n socket.removeListener(\"error\", onerror);\n socket.removeListener(\"readable\", read);\n }\n\n function onend() {\n cleanup();\n reject(\n new Error(\"Proxy connection ended before receiving CONNECT response\")\n );\n }\n\n function onerror(err: Error) {\n cleanup();\n reject(err);\n }\n\n function ondata(b: Buffer) {\n buffers.push(b);\n buffersLength += b.length;\n\n const buffered = Buffer.concat(buffers, buffersLength);\n const endOfHeaders = buffered.indexOf(\"\\r\\n\\r\\n\");\n\n if (endOfHeaders === -1) {\n // keep buffering\n read();\n return;\n }\n\n const headerParts = buffered\n .subarray(0, endOfHeaders)\n .toString(\"ascii\")\n .split(\"\\r\\n\");\n const firstLine = headerParts.shift();\n if (!firstLine) {\n socket.destroy();\n return reject(\n new Error(\"No header received from proxy CONNECT response\")\n );\n }\n const firstLineParts = firstLine.split(\" \");\n const statusCode = +firstLineParts[1]!;\n const statusText = firstLineParts.slice(2).join(\" \");\n const headers: IncomingHttpHeaders = {};\n for (const header of headerParts) {\n if (!header) continue;\n const firstColon = header.indexOf(\":\");\n if (firstColon === -1) {\n socket.destroy();\n return reject(\n new Error(`Invalid header from proxy CONNECT response: \"${header}\"`)\n );\n }\n const key = header.slice(0, firstColon).toLowerCase();\n const value = header.slice(firstColon + 1).trimStart();\n const current = headers[key];\n if (typeof current === \"string\") {\n headers[key] = [current, value];\n } else if (Array.isArray(current)) {\n current.push(value);\n } else {\n headers[key] = value;\n }\n }\n\n cleanup();\n resolve({\n connect: {\n statusCode,\n statusText,\n headers\n },\n buffered\n });\n }\n\n socket.on(\"error\", onerror);\n socket.on(\"end\", onend);\n\n read();\n });\n}\n"],"mappings":"qCAkCA,eAAsB,EACpB,EACyD,CACzD,OAAO,IAAI,SAAS,EAAS,IAAW,CAKtC,IAAI,EAAgB,EACdA,EAAoB,EAAE,CAE5B,SAAS,GAAO,CACd,IAAM,EAAI,EAAO,MAAM,CACnB,EAAG,EAAO,EAAE,CACX,EAAO,KAAK,WAAY,EAAK,CAGpC,SAAS,GAAU,CACjB,EAAO,eAAe,MAAO,EAAM,CACnC,EAAO,eAAe,QAAS,EAAQ,CACvC,EAAO,eAAe,WAAY,EAAK,CAGzC,SAAS,GAAQ,CACf,GAAS,CACT,EACM,MAAM,2DAA2D,CACtE,CAGH,SAAS,EAAQ,EAAY,CAC3B,GAAS,CACT,EAAO,EAAI,CAGb,SAAS,EAAO,EAAW,CACzB,EAAQ,KAAK,EAAE,CACf,GAAiB,EAAE,OAEnB,IAAM,EAAW,EAAO,OAAO,EAAS,EAAc,CAChD,EAAe,EAAS,QAAQ;;EAAW,CAEjD,GAAI,IAAiB,GAAI,CAEvB,GAAM,CACN,OAGF,IAAM,EAAc,EACjB,SAAS,EAAG,EAAa,CACzB,SAAS,QAAQ,CACjB,MAAM;EAAO,CACV,EAAY,EAAY,OAAO,CACrC,GAAI,CAAC,EAEH,OADA,EAAO,SAAS,CACT,EACD,MAAM,iDAAiD,CAC5D,CAEH,IAAM,EAAiB,EAAU,MAAM,IAAI,CACrC,EAAa,CAAC,EAAe,GAC7B,EAAa,EAAe,MAAM,EAAE,CAAC,KAAK,IAAI,CAC9CC,EAA+B,EAAE,CACvC,IAAK,IAAM,KAAU,EAAa,CAChC,GAAI,CAAC,EAAQ,SACb,IAAM,EAAa,EAAO,QAAQ,IAAI,CACtC,GAAI,IAAe,GAEjB,OADA,EAAO,SAAS,CACT,EACD,MAAM,gDAAgD,EAAO,GAAG,CACrE,CAEH,IAAM,EAAM,EAAO,MAAM,EAAG,EAAW,CAAC,aAAa,CAC/C,EAAQ,EAAO,MAAM,EAAa,EAAE,CAAC,WAAW,CAChD,EAAU,EAAQ,GACpB,OAAO,GAAY,SACrB,EAAQ,GAAO,CAAC,EAAS,EAAM,CACtB,MAAM,QAAQ,EAAQ,CAC/B,EAAQ,KAAK,EAAM,CAEnB,EAAQ,GAAO,EAInB,GAAS,CACT,EAAQ,CACN,QAAS,CACP,aACA,aACA,UACD,CACD,WACD,CAAC,CAGJ,EAAO,GAAG,QAAS,EAAQ,CAC3B,EAAO,GAAG,MAAO,EAAM,CAEvB,GAAM,EACN"}
1
+ {"version":3,"file":"parse-response.mjs","names":["buffers: Buffer[]","headers: IncomingHttpHeaders"],"sources":["../src/parse-response.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Buffer } from \"node:buffer\";\nimport type { IncomingHttpHeaders } from \"node:http\";\nimport type { Readable } from \"node:stream\";\n\nexport interface ConnectResponse {\n statusCode: number;\n statusText: string;\n headers: IncomingHttpHeaders;\n}\n\n/**\n * Parses the proxy CONNECT response from the given socket.\n *\n * @param socket - The socket to read the response from.\n * @returns A promise that resolves to the CONNECT response and any buffered data.\n */\nexport async function parseProxyResponse(\n socket: Readable\n): Promise<{ connect: ConnectResponse; buffered: Buffer }> {\n return new Promise((resolve, reject) => {\n // we need to buffer any HTTP traffic that happens with the proxy before we get\n // the CONNECT response, so that if the response is anything other than an \"200\"\n // response code, then we can re-play the \"data\" events on the socket once the\n // HTTP parser is hooked up...\n let buffersLength = 0;\n const buffers: Buffer[] = [];\n\n function read() {\n const b = socket.read();\n if (b) ondata(b);\n else socket.once(\"readable\", read);\n }\n\n function cleanup() {\n socket.removeListener(\"end\", onend);\n socket.removeListener(\"error\", onerror);\n socket.removeListener(\"readable\", read);\n }\n\n function onend() {\n cleanup();\n reject(\n new Error(\"Proxy connection ended before receiving CONNECT response\")\n );\n }\n\n function onerror(err: Error) {\n cleanup();\n reject(err);\n }\n\n function ondata(b: Buffer) {\n buffers.push(b);\n buffersLength += b.length;\n\n const buffered = Buffer.concat(buffers, buffersLength);\n const endOfHeaders = buffered.indexOf(\"\\r\\n\\r\\n\");\n\n if (endOfHeaders === -1) {\n // keep buffering\n read();\n return;\n }\n\n const headerParts = buffered\n .subarray(0, endOfHeaders)\n .toString(\"ascii\")\n .split(\"\\r\\n\");\n const firstLine = headerParts.shift();\n if (!firstLine) {\n socket.destroy();\n return reject(\n new Error(\"No header received from proxy CONNECT response\")\n );\n }\n const firstLineParts = firstLine.split(\" \");\n const statusCode = +firstLineParts[1]!;\n const statusText = firstLineParts.slice(2).join(\" \");\n const headers: IncomingHttpHeaders = {};\n for (const header of headerParts) {\n if (!header) continue;\n const firstColon = header.indexOf(\":\");\n if (firstColon === -1) {\n socket.destroy();\n return reject(\n new Error(`Invalid header from proxy CONNECT response: \"${header}\"`)\n );\n }\n const key = header.slice(0, firstColon).toLowerCase();\n const value = header.slice(firstColon + 1).trimStart();\n const current = headers[key];\n if (typeof current === \"string\") {\n headers[key] = [current, value];\n } else if (Array.isArray(current)) {\n current.push(value);\n } else {\n headers[key] = value;\n }\n }\n\n cleanup();\n resolve({\n connect: {\n statusCode,\n statusText,\n headers\n },\n buffered\n });\n }\n\n socket.on(\"error\", onerror);\n socket.on(\"end\", onend);\n\n read();\n });\n}\n"],"mappings":";;;;;;;;;AAkCA,eAAsB,mBACpB,QACyD;AACzD,QAAO,IAAI,SAAS,SAAS,WAAW;EAKtC,IAAI,gBAAgB;EACpB,MAAMA,UAAoB,EAAE;EAE5B,SAAS,OAAO;GACd,MAAM,IAAI,OAAO,MAAM;AACvB,OAAI,EAAG,QAAO,EAAE;OACX,QAAO,KAAK,YAAY,KAAK;;EAGpC,SAAS,UAAU;AACjB,UAAO,eAAe,OAAO,MAAM;AACnC,UAAO,eAAe,SAAS,QAAQ;AACvC,UAAO,eAAe,YAAY,KAAK;;EAGzC,SAAS,QAAQ;AACf,YAAS;AACT,0BACE,IAAI,MAAM,2DAA2D,CACtE;;EAGH,SAAS,QAAQ,KAAY;AAC3B,YAAS;AACT,UAAO,IAAI;;EAGb,SAAS,OAAO,GAAW;AACzB,WAAQ,KAAK,EAAE;AACf,oBAAiB,EAAE;GAEnB,MAAM,WAAW,OAAO,OAAO,SAAS,cAAc;GACtD,MAAM,eAAe,SAAS,QAAQ,WAAW;AAEjD,OAAI,iBAAiB,IAAI;AAEvB,UAAM;AACN;;GAGF,MAAM,cAAc,SACjB,SAAS,GAAG,aAAa,CACzB,SAAS,QAAQ,CACjB,MAAM,OAAO;GAChB,MAAM,YAAY,YAAY,OAAO;AACrC,OAAI,CAAC,WAAW;AACd,WAAO,SAAS;AAChB,WAAO,uBACL,IAAI,MAAM,iDAAiD,CAC5D;;GAEH,MAAM,iBAAiB,UAAU,MAAM,IAAI;GAC3C,MAAM,aAAa,CAAC,eAAe;GACnC,MAAM,aAAa,eAAe,MAAM,EAAE,CAAC,KAAK,IAAI;GACpD,MAAMC,UAA+B,EAAE;AACvC,QAAK,MAAM,UAAU,aAAa;AAChC,QAAI,CAAC,OAAQ;IACb,MAAM,aAAa,OAAO,QAAQ,IAAI;AACtC,QAAI,eAAe,IAAI;AACrB,YAAO,SAAS;AAChB,YAAO,uBACL,IAAI,MAAM,gDAAgD,OAAO,GAAG,CACrE;;IAEH,MAAM,MAAM,OAAO,MAAM,GAAG,WAAW,CAAC,aAAa;IACrD,MAAM,QAAQ,OAAO,MAAM,aAAa,EAAE,CAAC,WAAW;IACtD,MAAM,UAAU,QAAQ;AACxB,QAAI,OAAO,YAAY,SACrB,SAAQ,OAAO,CAAC,SAAS,MAAM;aACtB,MAAM,QAAQ,QAAQ,CAC/B,SAAQ,KAAK,MAAM;QAEnB,SAAQ,OAAO;;AAInB,YAAS;AACT,WAAQ;IACN,SAAS;KACP;KACA;KACA;KACD;IACD;IACD,CAAC;;AAGJ,SAAO,GAAG,SAAS,QAAQ;AAC3B,SAAO,GAAG,OAAO,MAAM;AAEvB,QAAM;GACN"}
@@ -1 +1,18 @@
1
- const e=require(`./http-proxy.cjs`),t=require(`./https-proxy.cjs`);function n(){let n=process.env.https_proxy||process.env.HTTPS_PROXY;if(n)return new t.HttpsProxyAgent(n);let r=process.env.http_proxy||process.env.HTTP_PROXY;if(r)return new e.HttpProxyAgent(r)}exports.getProxyAgent=n;
1
+ const require_http_proxy = require('./http-proxy.cjs');
2
+ const require_https_proxy = require('./https-proxy.cjs');
3
+
4
+ //#region src/proxy-agent.ts
5
+ /**
6
+ * If the http(s)_proxy environment variables is set, return a proxy agent.
7
+ *
8
+ * @returns The proxy agent or undefined if no proxy is set.
9
+ */
10
+ function getProxyAgent() {
11
+ const httpsProxy = process.env.https_proxy || process.env.HTTPS_PROXY;
12
+ if (httpsProxy) return new require_https_proxy.HttpsProxyAgent(httpsProxy);
13
+ const httpProxy = process.env.http_proxy || process.env.HTTP_PROXY;
14
+ if (httpProxy) return new require_http_proxy.HttpProxyAgent(httpProxy);
15
+ }
16
+
17
+ //#endregion
18
+ exports.getProxyAgent = getProxyAgent;
@@ -1,2 +1,19 @@
1
- import{HttpProxyAgent as e}from"./http-proxy.mjs";import{HttpsProxyAgent as t}from"./https-proxy.mjs";function n(){let n=process.env.https_proxy||process.env.HTTPS_PROXY;if(n)return new t(n);let r=process.env.http_proxy||process.env.HTTP_PROXY;if(r)return new e(r)}export{n as getProxyAgent};
1
+ import { HttpProxyAgent } from "./http-proxy.mjs";
2
+ import { HttpsProxyAgent } from "./https-proxy.mjs";
3
+
4
+ //#region src/proxy-agent.ts
5
+ /**
6
+ * If the http(s)_proxy environment variables is set, return a proxy agent.
7
+ *
8
+ * @returns The proxy agent or undefined if no proxy is set.
9
+ */
10
+ function getProxyAgent() {
11
+ const httpsProxy = process.env.https_proxy || process.env.HTTPS_PROXY;
12
+ if (httpsProxy) return new HttpsProxyAgent(httpsProxy);
13
+ const httpProxy = process.env.http_proxy || process.env.HTTP_PROXY;
14
+ if (httpProxy) return new HttpProxyAgent(httpProxy);
15
+ }
16
+
17
+ //#endregion
18
+ export { getProxyAgent };
2
19
  //# sourceMappingURL=proxy-agent.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-agent.mjs","names":[],"sources":["../src/proxy-agent.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Agent } from \"node:https\";\nimport { HttpProxyAgent } from \"./http-proxy\";\nimport { HttpsProxyAgent } from \"./https-proxy\";\n\n/**\n * If the http(s)_proxy environment variables is set, return a proxy agent.\n *\n * @returns The proxy agent or undefined if no proxy is set.\n */\nexport function getProxyAgent(): Agent | undefined {\n const httpsProxy = process.env.https_proxy || process.env.HTTPS_PROXY;\n if (httpsProxy) {\n return new HttpsProxyAgent(httpsProxy);\n }\n\n const httpProxy = process.env.http_proxy || process.env.HTTP_PROXY;\n if (httpProxy) {\n return new HttpProxyAgent(httpProxy);\n }\n\n return undefined;\n}\n"],"mappings":"sGA2BA,SAAgB,GAAmC,CACjD,IAAM,EAAa,QAAQ,IAAI,aAAe,QAAQ,IAAI,YAC1D,GAAI,EACF,OAAO,IAAI,EAAgB,EAAW,CAGxC,IAAM,EAAY,QAAQ,IAAI,YAAc,QAAQ,IAAI,WACxD,GAAI,EACF,OAAO,IAAI,EAAe,EAAU"}
1
+ {"version":3,"file":"proxy-agent.mjs","names":[],"sources":["../src/proxy-agent.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Agent } from \"node:https\";\nimport { HttpProxyAgent } from \"./http-proxy\";\nimport { HttpsProxyAgent } from \"./https-proxy\";\n\n/**\n * If the http(s)_proxy environment variables is set, return a proxy agent.\n *\n * @returns The proxy agent or undefined if no proxy is set.\n */\nexport function getProxyAgent(): Agent | undefined {\n const httpsProxy = process.env.https_proxy || process.env.HTTPS_PROXY;\n if (httpsProxy) {\n return new HttpsProxyAgent(httpsProxy);\n }\n\n const httpProxy = process.env.http_proxy || process.env.HTTP_PROXY;\n if (httpProxy) {\n return new HttpProxyAgent(httpProxy);\n }\n\n return undefined;\n}\n"],"mappings":";;;;;;;;;AA2BA,SAAgB,gBAAmC;CACjD,MAAM,aAAa,QAAQ,IAAI,eAAe,QAAQ,IAAI;AAC1D,KAAI,WACF,QAAO,IAAI,gBAAgB,WAAW;CAGxC,MAAM,YAAY,QAAQ,IAAI,cAAc,QAAQ,IAAI;AACxD,KAAI,UACF,QAAO,IAAI,eAAe,UAAU"}
@@ -1 +1,10 @@
1
- const e=require(`./is-null.cjs`),t=require(`./is-undefined.cjs`),n=require(`./is-empty.cjs`),r=require(`./is-boolean.cjs`),i=require(`./is-buffer.cjs`);require(`./type-detect.cjs`),require(`./is-collection.cjs`);const a=require(`./is-string.cjs`),o=require(`./is-set.cjs`),s=require(`./is-set-string.cjs`);
1
+ const require_is_null = require('./is-null.cjs');
2
+ const require_is_undefined = require('./is-undefined.cjs');
3
+ const require_is_empty = require('./is-empty.cjs');
4
+ const require_is_boolean = require('./is-boolean.cjs');
5
+ const require_is_buffer = require('./is-buffer.cjs');
6
+ require('./type-detect.cjs');
7
+ require('./is-collection.cjs');
8
+ const require_is_string = require('./is-string.cjs');
9
+ const require_is_set = require('./is-set.cjs');
10
+ const require_is_set_string = require('./is-set-string.cjs');
@@ -1 +1,12 @@
1
- import{isNull as e}from"./is-null.mjs";import{isUndefined as t}from"./is-undefined.mjs";import{isEmpty as n}from"./is-empty.mjs";import{isBoolean as r}from"./is-boolean.mjs";import{isBufferExists as i}from"./is-buffer.mjs";import"./type-detect.mjs";import"./is-collection.mjs";import{isString as a}from"./is-string.mjs";import{isSet as o}from"./is-set.mjs";import{isSetString as s}from"./is-set-string.mjs";export{};
1
+ import { isNull } from "./is-null.mjs";
2
+ import { isUndefined } from "./is-undefined.mjs";
3
+ import { isEmpty } from "./is-empty.mjs";
4
+ import { isBoolean } from "./is-boolean.mjs";
5
+ import { isBufferExists } from "./is-buffer.mjs";
6
+ import "./type-detect.mjs";
7
+ import "./is-collection.mjs";
8
+ import { isString } from "./is-string.mjs";
9
+ import { isSet } from "./is-set.mjs";
10
+ import { isSetString } from "./is-set-string.mjs";
11
+
12
+ export { };
@@ -1 +1,18 @@
1
- const e=e=>{try{return e instanceof Boolean||typeof e==`boolean`||!!e===e}catch{return!1}};exports.isBoolean=e;
1
+
2
+ //#region ../type-checks/src/is-boolean.ts
3
+ /**
4
+ * Check if the provided value's type is `boolean`
5
+ *
6
+ * @param value - The value to type check
7
+ * @returns An indicator specifying if the value provided is of type `boolean`
8
+ */
9
+ const isBoolean = (value) => {
10
+ try {
11
+ return value instanceof Boolean || typeof value === "boolean" || Boolean(value) === value;
12
+ } catch {
13
+ return false;
14
+ }
15
+ };
16
+
17
+ //#endregion
18
+ exports.isBoolean = isBoolean;
@@ -1,2 +1,18 @@
1
- const e=e=>{try{return e instanceof Boolean||typeof e==`boolean`||!!e===e}catch{return!1}};export{e as isBoolean};
1
+ //#region ../type-checks/src/is-boolean.ts
2
+ /**
3
+ * Check if the provided value's type is `boolean`
4
+ *
5
+ * @param value - The value to type check
6
+ * @returns An indicator specifying if the value provided is of type `boolean`
7
+ */
8
+ const isBoolean = (value) => {
9
+ try {
10
+ return value instanceof Boolean || typeof value === "boolean" || Boolean(value) === value;
11
+ } catch {
12
+ return false;
13
+ }
14
+ };
15
+
16
+ //#endregion
17
+ export { isBoolean };
2
18
  //# sourceMappingURL=is-boolean.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-boolean.mjs","names":[],"sources":["../../../../type-checks/src/is-boolean.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Check if the provided value's type is `boolean`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `boolean`\n */\nexport const isBoolean = (value: unknown): value is boolean => {\n try {\n return (\n value instanceof Boolean ||\n typeof value === \"boolean\" ||\n Boolean(value) === value\n );\n } catch {\n return false;\n }\n};\n"],"mappings":"AAwBA,MAAa,EAAa,GAAqC,CAC7D,GAAI,CACF,OACE,aAAiB,SACjB,OAAO,GAAU,WACjB,EAAQ,IAAW,OAEf,CACN,MAAO"}
1
+ {"version":3,"file":"is-boolean.mjs","names":[],"sources":["../../../../type-checks/src/is-boolean.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Check if the provided value's type is `boolean`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `boolean`\n */\nexport const isBoolean = (value: unknown): value is boolean => {\n try {\n return (\n value instanceof Boolean ||\n typeof value === \"boolean\" ||\n Boolean(value) === value\n );\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;AAwBA,MAAa,aAAa,UAAqC;AAC7D,KAAI;AACF,SACE,iBAAiB,WACjB,OAAO,UAAU,aACjB,QAAQ,MAAM,KAAK;SAEf;AACN,SAAO"}
@@ -1 +1,12 @@
1
- const e=typeof Buffer<`u`,t=e?Buffer.isBuffer.bind(Buffer):function(e){return!1};exports.isBufferExists=e;
1
+
2
+ //#region ../type-checks/src/is-buffer.ts
3
+ const isBufferExists = typeof Buffer !== "undefined";
4
+ /**
5
+ * Check if the provided value's type is `Buffer`
6
+ */
7
+ const isBuffer = isBufferExists ? Buffer.isBuffer.bind(Buffer) : function isBuffer$1(value) {
8
+ return false;
9
+ };
10
+
11
+ //#endregion
12
+ exports.isBufferExists = isBufferExists;
@@ -1,2 +1,12 @@
1
- const e=typeof Buffer<`u`;e&&Buffer.isBuffer.bind(Buffer);export{e as isBufferExists};
1
+ //#region ../type-checks/src/is-buffer.ts
2
+ const isBufferExists = typeof Buffer !== "undefined";
3
+ /**
4
+ * Check if the provided value's type is `Buffer`
5
+ */
6
+ const isBuffer = isBufferExists ? Buffer.isBuffer.bind(Buffer) : function isBuffer$1(value) {
7
+ return false;
8
+ };
9
+
10
+ //#endregion
11
+ export { isBufferExists };
2
12
  //# sourceMappingURL=is-buffer.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-buffer.mjs","names":["isBuffer: typeof Buffer.isBuffer","isBuffer"],"sources":["../../../../type-checks/src/is-buffer.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isBufferExists = typeof Buffer !== \"undefined\";\n\n/**\n * Check if the provided value's type is `Buffer`\n */\nexport const isBuffer: typeof Buffer.isBuffer = isBufferExists\n ? Buffer.isBuffer.bind(Buffer)\n : /**\n * Check if the provided value's type is `Buffer`\n\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Buffer`\n */\n function isBuffer(\n value: Parameters<typeof Buffer.isBuffer>[0]\n ): value is Buffer {\n return false;\n };\n"],"mappings":"AAkBA,MAAa,EAAiB,OAAO,OAAW,IAKA,GAC5C,OAAO,SAAS,KAAK,OAAO"}
1
+ {"version":3,"file":"is-buffer.mjs","names":["isBuffer: typeof Buffer.isBuffer","isBuffer"],"sources":["../../../../type-checks/src/is-buffer.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isBufferExists = typeof Buffer !== \"undefined\";\n\n/**\n * Check if the provided value's type is `Buffer`\n */\nexport const isBuffer: typeof Buffer.isBuffer = isBufferExists\n ? Buffer.isBuffer.bind(Buffer)\n : /**\n * Check if the provided value's type is `Buffer`\n\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `Buffer`\n */\n function isBuffer(\n value: Parameters<typeof Buffer.isBuffer>[0]\n ): value is Buffer {\n return false;\n };\n"],"mappings":";AAkBA,MAAa,iBAAiB,OAAO,WAAW;;;;AAKhD,MAAaA,WAAmC,iBAC5C,OAAO,SAAS,KAAK,OAAO,GAO5B,SAASC,WACP,OACiB;AACjB,QAAO"}
@@ -1 +1 @@
1
- require(`./type-detect.cjs`);
1
+ require('./type-detect.cjs');
@@ -1 +1,3 @@
1
- import"./type-detect.mjs";export{};
1
+ import "./type-detect.mjs";
2
+
3
+ export { };
@@ -1 +1,20 @@
1
- const e=require(`./is-null.cjs`),t=require(`./is-undefined.cjs`),n=n=>{try{return t.isUndefined(n)||e.isNull(n)}catch{return!1}};exports.isEmpty=n;
1
+ const require_is_null = require('./is-null.cjs');
2
+ const require_is_undefined = require('./is-undefined.cjs');
3
+
4
+ //#region ../type-checks/src/is-empty.ts
5
+ /**
6
+ * Check if the provided value's type is `null` or `undefined`
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is of type `null` or `undefined`
10
+ */
11
+ const isEmpty = (value) => {
12
+ try {
13
+ return require_is_undefined.isUndefined(value) || require_is_null.isNull(value);
14
+ } catch {
15
+ return false;
16
+ }
17
+ };
18
+
19
+ //#endregion
20
+ exports.isEmpty = isEmpty;
@@ -1,2 +1,21 @@
1
- import{isNull as e}from"./is-null.mjs";import{isUndefined as t}from"./is-undefined.mjs";const n=n=>{try{return t(n)||e(n)}catch{return!1}};export{n as isEmpty};
1
+ import { isNull } from "./is-null.mjs";
2
+ import { isUndefined } from "./is-undefined.mjs";
3
+
4
+ //#region ../type-checks/src/is-empty.ts
5
+ /**
6
+ * Check if the provided value's type is `null` or `undefined`
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is of type `null` or `undefined`
10
+ */
11
+ const isEmpty = (value) => {
12
+ try {
13
+ return isUndefined(value) || isNull(value);
14
+ } catch {
15
+ return false;
16
+ }
17
+ };
18
+
19
+ //#endregion
20
+ export { isEmpty };
2
21
  //# sourceMappingURL=is-empty.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-empty.mjs","names":[],"sources":["../../../../type-checks/src/is-empty.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isDate } from \"./is-date\";\nimport { isFunction } from \"./is-function\";\nimport { isNull } from \"./is-null\";\nimport { isNumber } from \"./is-number\";\nimport { isSymbol } from \"./is-symbol\";\nimport { isUndefined } from \"./is-undefined\";\n\n/**\n * Check if the provided value's type is `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined`\n */\nexport const isEmpty = (value: unknown) => {\n try {\n return isUndefined(value) || isNull(value);\n } catch {\n return false;\n }\n};\n\nexport const isEmptyAnything = (value: any) => {\n if (value === true || value === false) return true;\n if (value === null || value === undefined) return true;\n if (isNumber(value)) return value === 0;\n if (isDate(value)) return Number.isNaN(value.getTime());\n if (isFunction(value)) return false;\n if (isSymbol(value)) return false;\n const { length } = value;\n if (isNumber(length)) return length === 0;\n const { size } = value;\n if (isNumber(size)) return size === 0;\n const keys = Object.keys(value).length;\n\n return keys === 0;\n};\n"],"mappings":"wFA+BA,MAAa,EAAW,GAAmB,CACzC,GAAI,CACF,OAAO,EAAY,EAAM,EAAI,EAAO,EAAM,MACpC,CACN,MAAO"}
1
+ {"version":3,"file":"is-empty.mjs","names":[],"sources":["../../../../type-checks/src/is-empty.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isDate } from \"./is-date\";\nimport { isFunction } from \"./is-function\";\nimport { isNull } from \"./is-null\";\nimport { isNumber } from \"./is-number\";\nimport { isSymbol } from \"./is-symbol\";\nimport { isUndefined } from \"./is-undefined\";\n\n/**\n * Check if the provided value's type is `null` or `undefined`\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `null` or `undefined`\n */\nexport const isEmpty = (value: unknown) => {\n try {\n return isUndefined(value) || isNull(value);\n } catch {\n return false;\n }\n};\n\nexport const isEmptyAnything = (value: any) => {\n if (value === true || value === false) return true;\n if (value === null || value === undefined) return true;\n if (isNumber(value)) return value === 0;\n if (isDate(value)) return Number.isNaN(value.getTime());\n if (isFunction(value)) return false;\n if (isSymbol(value)) return false;\n const { length } = value;\n if (isNumber(length)) return length === 0;\n const { size } = value;\n if (isNumber(size)) return size === 0;\n const keys = Object.keys(value).length;\n\n return keys === 0;\n};\n"],"mappings":";;;;;;;;;;AA+BA,MAAa,WAAW,UAAmB;AACzC,KAAI;AACF,SAAO,YAAY,MAAM,IAAI,OAAO,MAAM;SACpC;AACN,SAAO"}
@@ -1 +1,12 @@
1
- const e=e=>{try{return e===null}catch{return!1}};exports.isNull=e;
1
+
2
+ //#region ../type-checks/src/is-null.ts
3
+ const isNull = (value) => {
4
+ try {
5
+ return value === null;
6
+ } catch {
7
+ return false;
8
+ }
9
+ };
10
+
11
+ //#endregion
12
+ exports.isNull = isNull;
@@ -1,2 +1,12 @@
1
- const e=e=>{try{return e===null}catch{return!1}};export{e as isNull};
1
+ //#region ../type-checks/src/is-null.ts
2
+ const isNull = (value) => {
3
+ try {
4
+ return value === null;
5
+ } catch {
6
+ return false;
7
+ }
8
+ };
9
+
10
+ //#endregion
11
+ export { isNull };
2
12
  //# sourceMappingURL=is-null.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-null.mjs","names":[],"sources":["../../../../type-checks/src/is-null.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isNull = (value: unknown): value is null => {\n try {\n return value === null;\n } catch {\n return false;\n }\n};\n"],"mappings":"AAkBA,MAAa,EAAU,GAAkC,CACvD,GAAI,CACF,OAAO,IAAU,UACX,CACN,MAAO"}
1
+ {"version":3,"file":"is-null.mjs","names":[],"sources":["../../../../type-checks/src/is-null.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isNull = (value: unknown): value is null => {\n try {\n return value === null;\n } catch {\n return false;\n }\n};\n"],"mappings":";AAkBA,MAAa,UAAU,UAAkC;AACvD,KAAI;AACF,SAAO,UAAU;SACX;AACN,SAAO"}
@@ -1 +1,20 @@
1
- const e=require(`./is-string.cjs`),t=require(`./is-set.cjs`),n=n=>{try{return t.isSet(n)&&e.isString(n)&&n.length>0}catch{return!1}};exports.isSetString=n;
1
+ const require_is_string = require('./is-string.cjs');
2
+ const require_is_set = require('./is-set.cjs');
3
+
4
+ //#region ../type-checks/src/is-set-string.ts
5
+ /**
6
+ * Determine if the type is string and is not empty (length greater than zero)
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is of type `string` and length greater than zero
10
+ */
11
+ const isSetString = (value) => {
12
+ try {
13
+ return require_is_set.isSet(value) && require_is_string.isString(value) && value.length > 0;
14
+ } catch {
15
+ return false;
16
+ }
17
+ };
18
+
19
+ //#endregion
20
+ exports.isSetString = isSetString;
@@ -1,2 +1,21 @@
1
- import{isString as e}from"./is-string.mjs";import{isSet as t}from"./is-set.mjs";const n=n=>{try{return t(n)&&e(n)&&n.length>0}catch{return!1}};export{n as isSetString};
1
+ import { isString } from "./is-string.mjs";
2
+ import { isSet } from "./is-set.mjs";
3
+
4
+ //#region ../type-checks/src/is-set-string.ts
5
+ /**
6
+ * Determine if the type is string and is not empty (length greater than zero)
7
+ *
8
+ * @param value - The value to type check
9
+ * @returns An indicator specifying if the value provided is of type `string` and length greater than zero
10
+ */
11
+ const isSetString = (value) => {
12
+ try {
13
+ return isSet(value) && isString(value) && value.length > 0;
14
+ } catch {
15
+ return false;
16
+ }
17
+ };
18
+
19
+ //#endregion
20
+ export { isSetString };
2
21
  //# sourceMappingURL=is-set-string.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-set-string.mjs","names":[],"sources":["../../../../type-checks/src/is-set-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isSet } from \"./is-set\";\nimport { isString } from \"./is-string\";\n\n/**\n * Determine if the type is string and is not empty (length greater than zero)\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `string` and length greater than zero\n */\nexport const isSetString = (value: unknown): value is NonNullable<string> => {\n try {\n return isSet(value) && isString(value) && value.length > 0;\n } catch {\n return false;\n }\n};\n"],"mappings":"gFA2BA,MAAa,EAAe,GAAiD,CAC3E,GAAI,CACF,OAAO,EAAM,EAAM,EAAI,EAAS,EAAM,EAAI,EAAM,OAAS,OACnD,CACN,MAAO"}
1
+ {"version":3,"file":"is-set-string.mjs","names":[],"sources":["../../../../type-checks/src/is-set-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isSet } from \"./is-set\";\nimport { isString } from \"./is-string\";\n\n/**\n * Determine if the type is string and is not empty (length greater than zero)\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is of type `string` and length greater than zero\n */\nexport const isSetString = (value: unknown): value is NonNullable<string> => {\n try {\n return isSet(value) && isString(value) && value.length > 0;\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;;AA2BA,MAAa,eAAe,UAAiD;AAC3E,KAAI;AACF,SAAO,MAAM,MAAM,IAAI,SAAS,MAAM,IAAI,MAAM,SAAS;SACnD;AACN,SAAO"}
@@ -1 +1,19 @@
1
- const e=require(`./is-empty.cjs`),t=t=>{try{return!e.isEmpty(t)}catch{return!1}};exports.isSet=t;
1
+ const require_is_empty = require('./is-empty.cjs');
2
+
3
+ //#region ../type-checks/src/is-set.ts
4
+ /**
5
+ * The inverse of the `isEmpty` function
6
+ *
7
+ * @param value - The value to type check
8
+ * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
9
+ */
10
+ const isSet = (value) => {
11
+ try {
12
+ return !require_is_empty.isEmpty(value);
13
+ } catch {
14
+ return false;
15
+ }
16
+ };
17
+
18
+ //#endregion
19
+ exports.isSet = isSet;
@@ -1,2 +1,20 @@
1
- import{isEmpty as e}from"./is-empty.mjs";const t=t=>{try{return!e(t)}catch{return!1}};export{t as isSet};
1
+ import { isEmpty } from "./is-empty.mjs";
2
+
3
+ //#region ../type-checks/src/is-set.ts
4
+ /**
5
+ * The inverse of the `isEmpty` function
6
+ *
7
+ * @param value - The value to type check
8
+ * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`
9
+ */
10
+ const isSet = (value) => {
11
+ try {
12
+ return !isEmpty(value);
13
+ } catch {
14
+ return false;
15
+ }
16
+ };
17
+
18
+ //#endregion
19
+ export { isSet };
2
20
  //# sourceMappingURL=is-set.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-set.mjs","names":[],"sources":["../../../../type-checks/src/is-set.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value);\n } catch {\n return false;\n }\n};\n"],"mappings":"yCA0BA,MAAa,EAAS,GAAkD,CACtE,GAAI,CACF,MAAO,CAAC,EAAQ,EAAM,MAChB,CACN,MAAO"}
1
+ {"version":3,"file":"is-set.mjs","names":[],"sources":["../../../../type-checks/src/is-set.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isEmpty } from \"./is-empty\";\n\n/**\n * The inverse of the `isEmpty` function\n *\n * @param value - The value to type check\n * @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n */\nexport const isSet = (value: unknown): value is NonNullable<unknown> => {\n try {\n return !isEmpty(value);\n } catch {\n return false;\n }\n};\n"],"mappings":";;;;;;;;;AA0BA,MAAa,SAAS,UAAkD;AACtE,KAAI;AACF,SAAO,CAAC,QAAQ,MAAM;SAChB;AACN,SAAO"}
@@ -1 +1,12 @@
1
- const e=e=>{try{return typeof e==`string`}catch{return!1}};exports.isString=e;
1
+
2
+ //#region ../type-checks/src/is-string.ts
3
+ const isString = (value) => {
4
+ try {
5
+ return typeof value === "string";
6
+ } catch {
7
+ return false;
8
+ }
9
+ };
10
+
11
+ //#endregion
12
+ exports.isString = isString;
@@ -1,2 +1,12 @@
1
- const e=e=>{try{return typeof e==`string`}catch{return!1}};export{e as isString};
1
+ //#region ../type-checks/src/is-string.ts
2
+ const isString = (value) => {
3
+ try {
4
+ return typeof value === "string";
5
+ } catch {
6
+ return false;
7
+ }
8
+ };
9
+
10
+ //#endregion
11
+ export { isString };
2
12
  //# sourceMappingURL=is-string.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-string.mjs","names":[],"sources":["../../../../type-checks/src/is-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isString = (value: unknown): value is string => {\n try {\n return typeof value === \"string\";\n } catch {\n return false;\n }\n};\n"],"mappings":"AAkBA,MAAa,EAAY,GAAoC,CAC3D,GAAI,CACF,OAAO,OAAO,GAAU,cAClB,CACN,MAAO"}
1
+ {"version":3,"file":"is-string.mjs","names":[],"sources":["../../../../type-checks/src/is-string.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isString = (value: unknown): value is string => {\n try {\n return typeof value === \"string\";\n } catch {\n return false;\n }\n};\n"],"mappings":";AAkBA,MAAa,YAAY,UAAoC;AAC3D,KAAI;AACF,SAAO,OAAO,UAAU;SAClB;AACN,SAAO"}
@@ -1 +1,8 @@
1
- const e=e=>e===void 0;exports.isUndefined=e;
1
+
2
+ //#region ../type-checks/src/is-undefined.ts
3
+ const isUndefined = (value) => {
4
+ return value === void 0;
5
+ };
6
+
7
+ //#endregion
8
+ exports.isUndefined = isUndefined;
@@ -1,2 +1,8 @@
1
- const e=e=>e===void 0;export{e as isUndefined};
1
+ //#region ../type-checks/src/is-undefined.ts
2
+ const isUndefined = (value) => {
3
+ return value === void 0;
4
+ };
5
+
6
+ //#endregion
7
+ export { isUndefined };
2
8
  //# sourceMappingURL=is-undefined.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-undefined.mjs","names":[],"sources":["../../../../type-checks/src/is-undefined.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isUndefined = (value: unknown): value is undefined => {\n return value === undefined;\n};\n"],"mappings":"AAkBA,MAAa,EAAe,GACnB,IAAU,IAAA"}
1
+ {"version":3,"file":"is-undefined.mjs","names":[],"sources":["../../../../type-checks/src/is-undefined.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const isUndefined = (value: unknown): value is undefined => {\n return value === undefined;\n};\n"],"mappings":";AAkBA,MAAa,eAAe,UAAuC;AACjE,QAAO,UAAU"}
@@ -1 +1,15 @@
1
- require(`./is-buffer.cjs`);const e=(e=>(typeof globalThis==`object`||Object.defineProperty(e,`typeDetectGlobalObject`,{get(){return this},configurable:!0}),globalThis))(Object.prototype);
1
+ require('./is-buffer.cjs');
2
+
3
+ //#region ../type-checks/src/type-detect.ts
4
+ const globalObject = ((Obj) => {
5
+ if (typeof globalThis === "object") return globalThis;
6
+ Object.defineProperty(Obj, "typeDetectGlobalObject", {
7
+ get() {
8
+ return this;
9
+ },
10
+ configurable: true
11
+ });
12
+ return globalThis;
13
+ })(Object.prototype);
14
+
15
+ //#endregion