Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@elysiajs/eden

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elysiajs/eden - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

2

dist/index.global.js

@@ -1,1 +0,1 @@

"use strict";var Eden=(()=>{var I=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var re=(t,e)=>{for(var r in e)I(t,r,{get:e[r],enumerable:!0})},ne=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of ee(e))!te.call(t,f)&&f!==r&&I(t,f,{get:()=>e[f],enumerable:!(s=Y(e,f))||s.enumerable});return t};var se=t=>ne(I({},"__esModule",{value:!0}),t);var ue={};re(ue,{edenFetch:()=>X,edenTreaty:()=>Q,treaty:()=>Z});var B=(t,e,r)=>{if(t.endsWith("/")||(t+="/"),e==="index"&&(e=""),!r||!Object.keys(r).length)return`${t}${e}`;let s="";for(let[f,n]of Object.entries(r))s+=`${f}=${n}&`;return`${t}${e}?${s.slice(0,-1)}`},F=t=>t.trim().length!==0&&!Number.isNaN(Number(t));var T=class extends Error{constructor(r,s){super(s+"");this.status=r;this.value=s}};var C=class{constructor(e){this.url=e;this.ws=new WebSocket(e)}ws;send(e){return Array.isArray(e)?(e.forEach(r=>this.send(r)),this):(this.ws.send(typeof e=="object"?JSON.stringify(e):e.toString()),this)}on(e,r,s){return this.addEventListener(e,r,s)}off(e,r,s){return this.ws.removeEventListener(e,r,s),this}subscribe(e,r){return this.addEventListener("message",e,r)}addEventListener(e,r,s){return this.ws.addEventListener(e,f=>{if(e==="message"){let n=f.data.toString(),a=n.charCodeAt(0);if(a===47||a===123)try{n=JSON.parse(n)}catch{}else F(n)?n=+n:n==="true"?n=!0:n==="false"&&(n=!1);r({...f,data:n})}else r(f)},s),this}removeEventListener(e,r,s){return this.off(e,r,s),this}close(){return this.ws.close(),this}};var ae=["get","post","put","delete","patch","options","head","connect","subscribe"],G=["localhost","127.0.0.1","0.0.0.0"],D=typeof FileList>"u",ie=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,oe=/(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{2}\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT(?:\+|-)\d{4}\s\([^)]+\)/,ce=/^(?:(?:(?:(?:0?[1-9]|[12][0-9]|3[01])[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:19|20)\d{2})|(?:(?:19|20)\d{2}[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:0?[1-9]|[12][0-9]|3[01]))))(?:\s(?:1[012]|0?[1-9]):[0-5][0-9](?::[0-5][0-9])?(?:\s[AP]M)?)?$/,_=t=>D?t instanceof Blob:t instanceof FileList||t instanceof File,fe=t=>{if(!t)return!1;for(let e in t)if(_(t[e])||Array.isArray(t[e])&&t[e].find(_))return!0;return!1},q=t=>D?t:new Promise(e=>{let r=new FileReader;r.onload=()=>{let s=new File([r.result],t.name,{lastModified:t.lastModified,type:t.type});e(s)},r.readAsArrayBuffer(t)}),K=(t,e,r=[],s)=>new Proxy(()=>{},{get(f,n){return K(t,e,n==="index"?r:[...r,n],s)},apply(f,n,[a,p]){if(!a||p||typeof a=="object"&&Object.keys(a).length!==1||ae.includes(r.at(-1))){let L=[...r],A=L.pop(),w="/"+L.join("/"),{fetcher:l=fetch,headers:i,onRequest:E,onResponse:x,fetch:R}=e,O=A==="get"||A==="head"||A==="subscribe";i={...typeof i=="object"&&!Array.isArray(i)?i:{},...O?a?.headers:p?.headers};let $=O?a?.query:p?.query,S="";if($)for(let[u,h]of Object.entries($))S+=(S?"&":"?")+`${u}=${h}`;if(typeof e.headers=="function"&&!(i instanceof Headers)){let u=e.headers(w,p??{});u&&(i={...i,...u})}else if(Array.isArray(e.headers)&&e.headers.every(u=>typeof u=="function"))for(let u of e.headers){let h=u(w,p??{});h&&(i={...i,...h})}else if(i instanceof Headers){i||(i={});for(let[u,h]of Object.entries(i))i[u]=h}if(A==="subscribe"){let u=t.replace(/^([^]+):\/\//,t.startsWith("https://")?"wss://":t.startsWith("http://")||G.find(h=>t.includes(h))?"ws://":"wss://")+w+S;return new C(u)}return(async()=>{let u=(i instanceof Headers?i.get("content-type"):Array.isArray(i)?i.find(o=>Array.isArray(o)&&o[0]==="headers"?o[1]:!1):typeof i=="function"?i(w,p??{}):i?.contentType)||p?.headers?.contentType;if(!u)if(typeof a=="object")u="application/json",a=JSON.stringify(a);else if(fe(a)){let o=new FormData;for(let[c,m]of Object.entries(a)){if(D){o.append(c,m);continue}if(m instanceof File){o.append(c,await q(m));continue}if(m instanceof FileList){for(let d=0;d<m.length;d++)o.append(c,await q(m[d]));continue}if(Array.isArray(m)){for(let d=0;d<m.length;d++){let v=m[d];o.append(c,v instanceof File?await q(v):v)}continue}o.append(c,m)}a=o}else a!=null&&(u="text/plain");let h={method:A?.toUpperCase(),body:a,...R,headers:{...i,"content-type":u}};if(O&&delete h.body,E){Array.isArray(E)||(E=[E]);for(let o of E){let c=await o(w,h);typeof c=="object"&&(h={...h,...c,headers:{...h.headers,...c.headers}})}}let N=t+w+S,y=await(s?.handle(new Request(N,h))??l(N,h)),b=null,g=null;if(x){Array.isArray(x)||(x=[x]);for(let o of x)try{let c=await o(y.clone());if(c!=null){b=c;break}}catch(c){c instanceof T?g=c:g=new T(422,c);break}}if(b===null){switch(y.headers.get("Content-Type")?.split(";")[0]){case"application/json":b=await y.json();break;case"application/octet-stream":b=await y.arrayBuffer();break;default:b=await y.text().then(o=>{if(F(o))return+o;if(o==="true")return!0;if(o==="false")return!1;if(!o)return o;let c=o.replace(/"/g,"");if(ie.test(c)||oe.test(c)||ce.test(c)){let m=new Date(c);if(!Number.isNaN(m.getTime()))return m}return o})}(y.status>=300||y.status<200)&&(g=new T(y.status,b),b=null)}return{data:b,error:g,response:y,status:y.status,headers:y.headers}})()}return typeof a=="object"?K(t,e,[...r,Object.values(a)[0]],s):K(t,e,r)}}),Z=(t,e={})=>typeof t=="string"?(e.keepDomain||(t.includes("://")||(t=(G.find(r=>t.includes(r))?"http://":"https://")+t),t.endsWith("/")&&(t=t.slice(0,-1))),K(t,e)):(typeof window<"u"&&console.warn("Elysia instance server found on client side, this is not recommended for security reason. Use generic type instead."),K("http://e.ly",e,[],t));var U=typeof FileList>"u",V=t=>U?t instanceof Blob:t instanceof FileList||t instanceof File,ye=t=>{if(!t)return!1;for(let e in t){if(V(t[e]))return!0;if(Array.isArray(t[e])&&t[e].find(r=>V(r)))return!0}return!1},J=t=>U?t:new Promise(e=>{let r=new FileReader;r.onload=()=>{let s=new File([r.result],t.name,{lastModified:t.lastModified,type:t.type});e(s)},r.readAsArrayBuffer(t)}),H=class{ws;url;constructor(e){this.ws=new WebSocket(e),this.url=e}send(e){return Array.isArray(e)?(e.forEach(r=>this.send(r)),this):(this.ws.send(typeof e=="object"?JSON.stringify(e):e.toString()),this)}on(e,r,s){return this.addEventListener(e,r,s)}off(e,r,s){return this.ws.removeEventListener(e,r,s),this}subscribe(e,r){return this.addEventListener("message",e,r)}addEventListener(e,r,s){return this.ws.addEventListener(e,f=>{if(e==="message"){let n=f.data.toString(),a=n.charCodeAt(0);if(a===47||a===123)try{n=JSON.parse(n)}catch{}else F(n)?n=+n:n==="true"?n=!0:n==="false"&&(n=!1);r({...f,data:n})}else r(f)},s),this}removeEventListener(e,r,s){return this.off(e,r,s),this}close(){return this.ws.close(),this}},z=(t,e="",r)=>new Proxy(()=>{},{get(s,f,n){return z(t,`${e}/${f.toString()}`,r)},apply(s,f,[n,a={}]=[{},{}]){let p=n!==void 0&&(typeof n!="object"||Array.isArray(n))?n:void 0,{$query:L,$fetch:A,$headers:w,$transform:l,getRaw:i,...E}=n??{};p??=E;let x=e.lastIndexOf("/"),R=e.slice(x+1).toUpperCase(),O=B(t,x===-1?"/":e.slice(0,x),Object.assign(a.query??{},L)),$=r.fetcher??fetch,S=r.transform?Array.isArray(r.transform)?r.transform:[r.transform]:void 0,u=l?Array.isArray(l)?l:[l]:void 0;return u&&(S?S=u.concat(S):S=u),R==="SUBSCRIBE"?new H(O.replace(/^([^]+):\/\//,O.startsWith("https://")?"wss://":"ws://")):(async N=>{let y,b={...r.$fetch?.headers,...A?.headers,...a.headers,...w};if(R!=="GET"&&R!=="HEAD"){y=Object.keys(p).length||Array.isArray(p)?p:void 0;let d=y&&(typeof y=="object"||Array.isArray(p));if(d&&ye(y)){let j=new FormData;for(let[M,k]of Object.entries(y))if(U)j.append(M,k);else if(k instanceof File)j.append(M,await J(k));else if(k instanceof FileList)for(let W=0;W<k.length;W++)j.append(M,await J(k[W]));else if(Array.isArray(k))for(let W=0;W<k.length;W++){let P=k[W];j.append(M,P instanceof File?await J(P):P)}else j.append(M,k);y=j}else y!=null&&(b["content-type"]=d?"application/json":"text/plain",y=d?JSON.stringify(y):p)}let g=await $(O,{method:R,body:y,...r.$fetch,...a.fetch,...A,headers:b}),o;if(N.getRaw)return g;switch(g.headers.get("Content-Type")?.split(";")[0]){case"application/json":o=await g.json();break;default:o=await g.text().then(d=>F(d)?+d:d==="true"?!0:d==="false"?!1:d)}let c=g.status>=300||g.status<200?new T(g.status,o):null,m={data:o,error:c,response:g,status:g.status,headers:g.headers};if(S)for(let d of S){let v=d(m);v instanceof Promise&&(v=await v),v!=null&&(m=v)}return m})({getRaw:i})}}),Q=(t,e={fetcher:fetch})=>new Proxy({},{get(r,s){return z(t,s,e)}});var X=(t,e)=>(r,{query:s,params:f,body:n,...a}={})=>{f&&Object.entries(f).forEach(([l,i])=>{r=r.replace(`:${l}`,i)});let p=a.headers?.["Content-Type"];if(!p||p==="application/json")try{n=JSON.stringify(n)}catch{}let L=e?.fetcher||globalThis.fetch,A=s?`?${new URLSearchParams(s).toString()}`:"",w=()=>L(t+r+A,{...a,method:a.method?.toUpperCase()||"GET",headers:n?{"content-type":"application/json",...a.headers}:a.headers,body:n}).then(async l=>{let i;switch(l.headers.get("Content-Type")?.split(";")[0]){case"application/json":i=await l.json();break;default:i=await l.text().then(E=>F(E)?parseInt(E):E==="true"?!0:E==="false"?!1:E);break}return l.status>300?{data:null,status:l.status,headers:l.headers,retry:w,error:new T(l.status,i)}:{data:i,error:null,status:l.status,headers:l.headers,retry:w}});return w()};return se(ue);})();
"use strict";var Eden=(()=>{var I=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var re=(t,e)=>{for(var r in e)I(t,r,{get:e[r],enumerable:!0})},ne=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let y of ee(e))!te.call(t,y)&&y!==r&&I(t,y,{get:()=>e[y],enumerable:!(s=Y(e,y))||s.enumerable});return t};var se=t=>ne(I({},"__esModule",{value:!0}),t);var de={};re(de,{edenFetch:()=>X,edenTreaty:()=>Q,treaty:()=>Z});var B=(t,e,r)=>{if(t.endsWith("/")||(t+="/"),e==="index"&&(e=""),!r||!Object.keys(r).length)return`${t}${e}`;let s="";for(let[y,n]of Object.entries(r))s+=`${y}=${n}&`;return`${t}${e}?${s.slice(0,-1)}`},F=t=>t.trim().length!==0&&!Number.isNaN(Number(t));var x=class extends Error{constructor(r,s){super(s+"");this.status=r;this.value=s}};var C=class{constructor(e){this.url=e;this.ws=new WebSocket(e)}ws;send(e){return Array.isArray(e)?(e.forEach(r=>this.send(r)),this):(this.ws.send(typeof e=="object"?JSON.stringify(e):e.toString()),this)}on(e,r,s){return this.addEventListener(e,r,s)}off(e,r,s){return this.ws.removeEventListener(e,r,s),this}subscribe(e,r){return this.addEventListener("message",e,r)}addEventListener(e,r,s){return this.ws.addEventListener(e,y=>{if(e==="message"){let n=y.data.toString(),c=n.charCodeAt(0);if(c===47||c===123)try{n=JSON.parse(n)}catch{}else F(n)?n=+n:n==="true"?n=!0:n==="false"&&(n=!1);r({...y,data:n})}else r(y)},s),this}removeEventListener(e,r,s){return this.off(e,r,s),this}close(){return this.ws.close(),this}};var ae=["get","post","put","delete","patch","options","head","connect","subscribe"],G=["localhost","127.0.0.1","0.0.0.0"],D=typeof FileList>"u",ie=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,oe=/(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{2}\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT(?:\+|-)\d{4}\s\([^)]+\)/,ce=/^(?:(?:(?:(?:0?[1-9]|[12][0-9]|3[01])[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:19|20)\d{2})|(?:(?:19|20)\d{2}[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:0?[1-9]|[12][0-9]|3[01]))))(?:\s(?:1[012]|0?[1-9]):[0-5][0-9](?::[0-5][0-9])?(?:\s[AP]M)?)?$/,_=t=>D?t instanceof Blob:t instanceof FileList||t instanceof File,fe=t=>{if(!t)return!1;for(let e in t)if(_(t[e])||Array.isArray(t[e])&&t[e].find(_))return!0;return!1},q=t=>D?t:new Promise(e=>{let r=new FileReader;r.onload=()=>{let s=new File([r.result],t.name,{lastModified:t.lastModified,type:t.type});e(s)},r.readAsArrayBuffer(t)}),K=(t,e,r=[],s)=>new Proxy(()=>{},{get(y,n){return K(t,e,n==="index"?r:[...r,n],s)},apply(y,n,[c,p]){if(!c||p||typeof c=="object"&&Object.keys(c).length!==1||ae.includes(r.at(-1))){let L=[...r],A=L.pop(),E="/"+L.join("/"),{fetcher:u=fetch,headers:a,onRequest:b,onResponse:T,fetch:R}=e,O=A==="get"||A==="head"||A==="subscribe";a={...typeof a=="object"&&!Array.isArray(a)?a:{},...O?c?.headers:p?.headers};let $=O?c?.query:p?.query,w="";if($)for(let[h,o]of Object.entries($))w+=(w?"&":"?")+`${h}=${o}`;if(typeof e.headers=="function"&&!(a instanceof Headers)){let h=e.headers(E,p??{});h&&(a={...a,...h})}else if(Array.isArray(e.headers)&&e.headers.every(h=>typeof h=="function"))for(let h of e.headers){let o=h(E,p??{});o&&(a={...a,...o})}else if(a instanceof Headers){a||(a={});for(let[h,o]of Object.entries(a))a[h]=o}if(A==="subscribe"){let h=t.replace(/^([^]+):\/\//,t.startsWith("https://")?"wss://":t.startsWith("http://")||G.find(o=>t.includes(o))?"ws://":"wss://")+E+w;return new C(h)}return(async()=>{let h=(a instanceof Headers?a.get("content-type"):Array.isArray(a)?a.find(i=>Array.isArray(i)&&i[0]==="headers"?i[1]:!1):typeof a=="function"?a(E,p??{}):a?.["content-type"])||p?.headers?.["content-type"],o={method:A?.toUpperCase(),body:c,...R,headers:{...a,"content-type":h}};if(O&&delete o.body,b){Array.isArray(b)||(b=[b]);for(let i of b){let f=await i(E,o);typeof f=="object"&&(o={...o,...f,headers:{...o.headers,...f.headers}})}}if(typeof o.body=="object")o.headers["content-type"]="application/json",o.body=JSON.stringify(o.body);else if(fe(o.body)){let i=new FormData;for(let[f,m]of Object.entries(o.body)){if(D){i.append(f,m);continue}if(m instanceof File){i.append(f,await q(m));continue}if(m instanceof FileList){for(let l=0;l<m.length;l++)i.append(f,await q(m[l]));continue}if(Array.isArray(m)){for(let l=0;l<m.length;l++){let v=m[l];i.append(f,v instanceof File?await q(v):v)}continue}i.append(f,m)}o.body=i}else o.body!==void 0&&(o.headers["content-type"]="text/plain");let N=t+E+w,d=await(s?.handle(new Request(N,o))??u(N,o)),S=null,g=null;if(T){Array.isArray(T)||(T=[T]);for(let i of T)try{let f=await i(d.clone());if(f!=null){S=f;break}}catch(f){f instanceof x?g=f:g=new x(422,f);break}}if(S===null){switch(d.headers.get("Content-Type")?.split(";")[0]){case"application/json":S=await d.json();break;case"application/octet-stream":S=await d.arrayBuffer();break;default:S=await d.text().then(i=>{if(F(i))return+i;if(i==="true")return!0;if(i==="false")return!1;if(!i)return i;let f=i.replace(/"/g,"");if(ie.test(f)||oe.test(f)||ce.test(f)){let m=new Date(f);if(!Number.isNaN(m.getTime()))return m}return i})}(d.status>=300||d.status<200)&&(g=new x(d.status,S),S=null)}return{data:S,error:g,response:d,status:d.status,headers:d.headers}})()}return typeof c=="object"?K(t,e,[...r,Object.values(c)[0]],s):K(t,e,r)}}),Z=(t,e={})=>typeof t=="string"?(e.keepDomain||(t.includes("://")||(t=(G.find(r=>t.includes(r))?"http://":"https://")+t),t.endsWith("/")&&(t=t.slice(0,-1))),K(t,e)):(typeof window<"u"&&console.warn("Elysia instance server found on client side, this is not recommended for security reason. Use generic type instead."),K("http://e.ly",e,[],t));var U=typeof FileList>"u",V=t=>U?t instanceof Blob:t instanceof FileList||t instanceof File,ye=t=>{if(!t)return!1;for(let e in t){if(V(t[e]))return!0;if(Array.isArray(t[e])&&t[e].find(r=>V(r)))return!0}return!1},J=t=>U?t:new Promise(e=>{let r=new FileReader;r.onload=()=>{let s=new File([r.result],t.name,{lastModified:t.lastModified,type:t.type});e(s)},r.readAsArrayBuffer(t)}),H=class{ws;url;constructor(e){this.ws=new WebSocket(e),this.url=e}send(e){return Array.isArray(e)?(e.forEach(r=>this.send(r)),this):(this.ws.send(typeof e=="object"?JSON.stringify(e):e.toString()),this)}on(e,r,s){return this.addEventListener(e,r,s)}off(e,r,s){return this.ws.removeEventListener(e,r,s),this}subscribe(e,r){return this.addEventListener("message",e,r)}addEventListener(e,r,s){return this.ws.addEventListener(e,y=>{if(e==="message"){let n=y.data.toString(),c=n.charCodeAt(0);if(c===47||c===123)try{n=JSON.parse(n)}catch{}else F(n)?n=+n:n==="true"?n=!0:n==="false"&&(n=!1);r({...y,data:n})}else r(y)},s),this}removeEventListener(e,r,s){return this.off(e,r,s),this}close(){return this.ws.close(),this}},z=(t,e="",r)=>new Proxy(()=>{},{get(s,y,n){return z(t,`${e}/${y.toString()}`,r)},apply(s,y,[n,c={}]=[{},{}]){let p=n!==void 0&&(typeof n!="object"||Array.isArray(n))?n:void 0,{$query:L,$fetch:A,$headers:E,$transform:u,getRaw:a,...b}=n??{};p??=b;let T=e.lastIndexOf("/"),R=e.slice(T+1).toUpperCase(),O=B(t,T===-1?"/":e.slice(0,T),Object.assign(c.query??{},L)),$=r.fetcher??fetch,w=r.transform?Array.isArray(r.transform)?r.transform:[r.transform]:void 0,h=u?Array.isArray(u)?u:[u]:void 0;return h&&(w?w=h.concat(w):w=h),R==="SUBSCRIBE"?new H(O.replace(/^([^]+):\/\//,O.startsWith("https://")?"wss://":"ws://")):(async N=>{let d,S={...r.$fetch?.headers,...A?.headers,...c.headers,...E};if(R!=="GET"&&R!=="HEAD"){d=Object.keys(p).length||Array.isArray(p)?p:void 0;let l=d&&(typeof d=="object"||Array.isArray(p));if(l&&ye(d)){let j=new FormData;for(let[M,k]of Object.entries(d))if(U)j.append(M,k);else if(k instanceof File)j.append(M,await J(k));else if(k instanceof FileList)for(let W=0;W<k.length;W++)j.append(M,await J(k[W]));else if(Array.isArray(k))for(let W=0;W<k.length;W++){let P=k[W];j.append(M,P instanceof File?await J(P):P)}else j.append(M,k);d=j}else d!=null&&(S["content-type"]=l?"application/json":"text/plain",d=l?JSON.stringify(d):p)}let g=await $(O,{method:R,body:d,...r.$fetch,...c.fetch,...A,headers:S}),i;if(N.getRaw)return g;switch(g.headers.get("Content-Type")?.split(";")[0]){case"application/json":i=await g.json();break;default:i=await g.text().then(l=>F(l)?+l:l==="true"?!0:l==="false"?!1:l)}let f=g.status>=300||g.status<200?new x(g.status,i):null,m={data:i,error:f,response:g,status:g.status,headers:g.headers};if(w)for(let l of w){let v=l(m);v instanceof Promise&&(v=await v),v!=null&&(m=v)}return m})({getRaw:a})}}),Q=(t,e={fetcher:fetch})=>new Proxy({},{get(r,s){return z(t,s,e)}});var X=(t,e)=>(r,{query:s,params:y,body:n,...c}={})=>{y&&Object.entries(y).forEach(([u,a])=>{r=r.replace(`:${u}`,a)});let p=c.headers?.["Content-Type"];if(!p||p==="application/json")try{n=JSON.stringify(n)}catch{}let L=e?.fetcher||globalThis.fetch,A=s?`?${new URLSearchParams(s).toString()}`:"",E=()=>L(t+r+A,{...c,method:c.method?.toUpperCase()||"GET",headers:n?{"content-type":"application/json",...c.headers}:c.headers,body:n}).then(async u=>{let a;switch(u.headers.get("Content-Type")?.split(";")[0]){case"application/json":a=await u.json();break;default:a=await u.text().then(b=>F(b)?parseInt(b):b==="true"?!0:b==="false"?!1:b);break}return u.status>300?{data:null,status:u.status,headers:u.headers,retry:E,error:new x(u.status,a)}:{data:a,error:null,status:u.status,headers:u.headers,retry:E}});return E()};return se(de);})();

@@ -1,1 +0,1 @@

"use strict";var I=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var re=(t,e)=>{for(var r in e)I(t,r,{get:e[r],enumerable:!0})},ne=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of ee(e))!te.call(t,f)&&f!==r&&I(t,f,{get:()=>e[f],enumerable:!(s=Y(e,f))||s.enumerable});return t};var se=t=>ne(I({},"__esModule",{value:!0}),t);var ue={};re(ue,{edenFetch:()=>X,edenTreaty:()=>Q,treaty:()=>Z});module.exports=se(ue);var B=(t,e,r)=>{if(t.endsWith("/")||(t+="/"),e==="index"&&(e=""),!r||!Object.keys(r).length)return`${t}${e}`;let s="";for(let[f,n]of Object.entries(r))s+=`${f}=${n}&`;return`${t}${e}?${s.slice(0,-1)}`},F=t=>t.trim().length!==0&&!Number.isNaN(Number(t));var T=class extends Error{constructor(r,s){super(s+"");this.status=r;this.value=s}};var C=class{constructor(e){this.url=e;this.ws=new WebSocket(e)}ws;send(e){return Array.isArray(e)?(e.forEach(r=>this.send(r)),this):(this.ws.send(typeof e=="object"?JSON.stringify(e):e.toString()),this)}on(e,r,s){return this.addEventListener(e,r,s)}off(e,r,s){return this.ws.removeEventListener(e,r,s),this}subscribe(e,r){return this.addEventListener("message",e,r)}addEventListener(e,r,s){return this.ws.addEventListener(e,f=>{if(e==="message"){let n=f.data.toString(),a=n.charCodeAt(0);if(a===47||a===123)try{n=JSON.parse(n)}catch{}else F(n)?n=+n:n==="true"?n=!0:n==="false"&&(n=!1);r({...f,data:n})}else r(f)},s),this}removeEventListener(e,r,s){return this.off(e,r,s),this}close(){return this.ws.close(),this}};var ae=["get","post","put","delete","patch","options","head","connect","subscribe"],G=["localhost","127.0.0.1","0.0.0.0"],D=typeof FileList>"u",ie=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,oe=/(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{2}\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT(?:\+|-)\d{4}\s\([^)]+\)/,ce=/^(?:(?:(?:(?:0?[1-9]|[12][0-9]|3[01])[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:19|20)\d{2})|(?:(?:19|20)\d{2}[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:0?[1-9]|[12][0-9]|3[01]))))(?:\s(?:1[012]|0?[1-9]):[0-5][0-9](?::[0-5][0-9])?(?:\s[AP]M)?)?$/,_=t=>D?t instanceof Blob:t instanceof FileList||t instanceof File,fe=t=>{if(!t)return!1;for(let e in t)if(_(t[e])||Array.isArray(t[e])&&t[e].find(_))return!0;return!1},q=t=>D?t:new Promise(e=>{let r=new FileReader;r.onload=()=>{let s=new File([r.result],t.name,{lastModified:t.lastModified,type:t.type});e(s)},r.readAsArrayBuffer(t)}),K=(t,e,r=[],s)=>new Proxy(()=>{},{get(f,n){return K(t,e,n==="index"?r:[...r,n],s)},apply(f,n,[a,p]){if(!a||p||typeof a=="object"&&Object.keys(a).length!==1||ae.includes(r.at(-1))){let L=[...r],A=L.pop(),w="/"+L.join("/"),{fetcher:l=fetch,headers:i,onRequest:E,onResponse:x,fetch:R}=e,O=A==="get"||A==="head"||A==="subscribe";i={...typeof i=="object"&&!Array.isArray(i)?i:{},...O?a?.headers:p?.headers};let $=O?a?.query:p?.query,S="";if($)for(let[u,h]of Object.entries($))S+=(S?"&":"?")+`${u}=${h}`;if(typeof e.headers=="function"&&!(i instanceof Headers)){let u=e.headers(w,p??{});u&&(i={...i,...u})}else if(Array.isArray(e.headers)&&e.headers.every(u=>typeof u=="function"))for(let u of e.headers){let h=u(w,p??{});h&&(i={...i,...h})}else if(i instanceof Headers){i||(i={});for(let[u,h]of Object.entries(i))i[u]=h}if(A==="subscribe"){let u=t.replace(/^([^]+):\/\//,t.startsWith("https://")?"wss://":t.startsWith("http://")||G.find(h=>t.includes(h))?"ws://":"wss://")+w+S;return new C(u)}return(async()=>{let u=(i instanceof Headers?i.get("content-type"):Array.isArray(i)?i.find(o=>Array.isArray(o)&&o[0]==="headers"?o[1]:!1):typeof i=="function"?i(w,p??{}):i?.contentType)||p?.headers?.contentType;if(!u)if(typeof a=="object")u="application/json",a=JSON.stringify(a);else if(fe(a)){let o=new FormData;for(let[c,m]of Object.entries(a)){if(D){o.append(c,m);continue}if(m instanceof File){o.append(c,await q(m));continue}if(m instanceof FileList){for(let d=0;d<m.length;d++)o.append(c,await q(m[d]));continue}if(Array.isArray(m)){for(let d=0;d<m.length;d++){let v=m[d];o.append(c,v instanceof File?await q(v):v)}continue}o.append(c,m)}a=o}else a!=null&&(u="text/plain");let h={method:A?.toUpperCase(),body:a,...R,headers:{...i,"content-type":u}};if(O&&delete h.body,E){Array.isArray(E)||(E=[E]);for(let o of E){let c=await o(w,h);typeof c=="object"&&(h={...h,...c,headers:{...h.headers,...c.headers}})}}let N=t+w+S,y=await(s?.handle(new Request(N,h))??l(N,h)),b=null,g=null;if(x){Array.isArray(x)||(x=[x]);for(let o of x)try{let c=await o(y.clone());if(c!=null){b=c;break}}catch(c){c instanceof T?g=c:g=new T(422,c);break}}if(b===null){switch(y.headers.get("Content-Type")?.split(";")[0]){case"application/json":b=await y.json();break;case"application/octet-stream":b=await y.arrayBuffer();break;default:b=await y.text().then(o=>{if(F(o))return+o;if(o==="true")return!0;if(o==="false")return!1;if(!o)return o;let c=o.replace(/"/g,"");if(ie.test(c)||oe.test(c)||ce.test(c)){let m=new Date(c);if(!Number.isNaN(m.getTime()))return m}return o})}(y.status>=300||y.status<200)&&(g=new T(y.status,b),b=null)}return{data:b,error:g,response:y,status:y.status,headers:y.headers}})()}return typeof a=="object"?K(t,e,[...r,Object.values(a)[0]],s):K(t,e,r)}}),Z=(t,e={})=>typeof t=="string"?(e.keepDomain||(t.includes("://")||(t=(G.find(r=>t.includes(r))?"http://":"https://")+t),t.endsWith("/")&&(t=t.slice(0,-1))),K(t,e)):(typeof window<"u"&&console.warn("Elysia instance server found on client side, this is not recommended for security reason. Use generic type instead."),K("http://e.ly",e,[],t));var U=typeof FileList>"u",V=t=>U?t instanceof Blob:t instanceof FileList||t instanceof File,ye=t=>{if(!t)return!1;for(let e in t){if(V(t[e]))return!0;if(Array.isArray(t[e])&&t[e].find(r=>V(r)))return!0}return!1},J=t=>U?t:new Promise(e=>{let r=new FileReader;r.onload=()=>{let s=new File([r.result],t.name,{lastModified:t.lastModified,type:t.type});e(s)},r.readAsArrayBuffer(t)}),H=class{ws;url;constructor(e){this.ws=new WebSocket(e),this.url=e}send(e){return Array.isArray(e)?(e.forEach(r=>this.send(r)),this):(this.ws.send(typeof e=="object"?JSON.stringify(e):e.toString()),this)}on(e,r,s){return this.addEventListener(e,r,s)}off(e,r,s){return this.ws.removeEventListener(e,r,s),this}subscribe(e,r){return this.addEventListener("message",e,r)}addEventListener(e,r,s){return this.ws.addEventListener(e,f=>{if(e==="message"){let n=f.data.toString(),a=n.charCodeAt(0);if(a===47||a===123)try{n=JSON.parse(n)}catch{}else F(n)?n=+n:n==="true"?n=!0:n==="false"&&(n=!1);r({...f,data:n})}else r(f)},s),this}removeEventListener(e,r,s){return this.off(e,r,s),this}close(){return this.ws.close(),this}},z=(t,e="",r)=>new Proxy(()=>{},{get(s,f,n){return z(t,`${e}/${f.toString()}`,r)},apply(s,f,[n,a={}]=[{},{}]){let p=n!==void 0&&(typeof n!="object"||Array.isArray(n))?n:void 0,{$query:L,$fetch:A,$headers:w,$transform:l,getRaw:i,...E}=n??{};p??=E;let x=e.lastIndexOf("/"),R=e.slice(x+1).toUpperCase(),O=B(t,x===-1?"/":e.slice(0,x),Object.assign(a.query??{},L)),$=r.fetcher??fetch,S=r.transform?Array.isArray(r.transform)?r.transform:[r.transform]:void 0,u=l?Array.isArray(l)?l:[l]:void 0;return u&&(S?S=u.concat(S):S=u),R==="SUBSCRIBE"?new H(O.replace(/^([^]+):\/\//,O.startsWith("https://")?"wss://":"ws://")):(async N=>{let y,b={...r.$fetch?.headers,...A?.headers,...a.headers,...w};if(R!=="GET"&&R!=="HEAD"){y=Object.keys(p).length||Array.isArray(p)?p:void 0;let d=y&&(typeof y=="object"||Array.isArray(p));if(d&&ye(y)){let j=new FormData;for(let[M,k]of Object.entries(y))if(U)j.append(M,k);else if(k instanceof File)j.append(M,await J(k));else if(k instanceof FileList)for(let W=0;W<k.length;W++)j.append(M,await J(k[W]));else if(Array.isArray(k))for(let W=0;W<k.length;W++){let P=k[W];j.append(M,P instanceof File?await J(P):P)}else j.append(M,k);y=j}else y!=null&&(b["content-type"]=d?"application/json":"text/plain",y=d?JSON.stringify(y):p)}let g=await $(O,{method:R,body:y,...r.$fetch,...a.fetch,...A,headers:b}),o;if(N.getRaw)return g;switch(g.headers.get("Content-Type")?.split(";")[0]){case"application/json":o=await g.json();break;default:o=await g.text().then(d=>F(d)?+d:d==="true"?!0:d==="false"?!1:d)}let c=g.status>=300||g.status<200?new T(g.status,o):null,m={data:o,error:c,response:g,status:g.status,headers:g.headers};if(S)for(let d of S){let v=d(m);v instanceof Promise&&(v=await v),v!=null&&(m=v)}return m})({getRaw:i})}}),Q=(t,e={fetcher:fetch})=>new Proxy({},{get(r,s){return z(t,s,e)}});var X=(t,e)=>(r,{query:s,params:f,body:n,...a}={})=>{f&&Object.entries(f).forEach(([l,i])=>{r=r.replace(`:${l}`,i)});let p=a.headers?.["Content-Type"];if(!p||p==="application/json")try{n=JSON.stringify(n)}catch{}let L=e?.fetcher||globalThis.fetch,A=s?`?${new URLSearchParams(s).toString()}`:"",w=()=>L(t+r+A,{...a,method:a.method?.toUpperCase()||"GET",headers:n?{"content-type":"application/json",...a.headers}:a.headers,body:n}).then(async l=>{let i;switch(l.headers.get("Content-Type")?.split(";")[0]){case"application/json":i=await l.json();break;default:i=await l.text().then(E=>F(E)?parseInt(E):E==="true"?!0:E==="false"?!1:E);break}return l.status>300?{data:null,status:l.status,headers:l.headers,retry:w,error:new T(l.status,i)}:{data:i,error:null,status:l.status,headers:l.headers,retry:w}});return w()};0&&(module.exports={edenFetch,edenTreaty,treaty});
"use strict";var I=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var re=(t,e)=>{for(var r in e)I(t,r,{get:e[r],enumerable:!0})},ne=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let y of ee(e))!te.call(t,y)&&y!==r&&I(t,y,{get:()=>e[y],enumerable:!(s=Y(e,y))||s.enumerable});return t};var se=t=>ne(I({},"__esModule",{value:!0}),t);var de={};re(de,{edenFetch:()=>X,edenTreaty:()=>Q,treaty:()=>Z});module.exports=se(de);var B=(t,e,r)=>{if(t.endsWith("/")||(t+="/"),e==="index"&&(e=""),!r||!Object.keys(r).length)return`${t}${e}`;let s="";for(let[y,n]of Object.entries(r))s+=`${y}=${n}&`;return`${t}${e}?${s.slice(0,-1)}`},F=t=>t.trim().length!==0&&!Number.isNaN(Number(t));var x=class extends Error{constructor(r,s){super(s+"");this.status=r;this.value=s}};var C=class{constructor(e){this.url=e;this.ws=new WebSocket(e)}ws;send(e){return Array.isArray(e)?(e.forEach(r=>this.send(r)),this):(this.ws.send(typeof e=="object"?JSON.stringify(e):e.toString()),this)}on(e,r,s){return this.addEventListener(e,r,s)}off(e,r,s){return this.ws.removeEventListener(e,r,s),this}subscribe(e,r){return this.addEventListener("message",e,r)}addEventListener(e,r,s){return this.ws.addEventListener(e,y=>{if(e==="message"){let n=y.data.toString(),c=n.charCodeAt(0);if(c===47||c===123)try{n=JSON.parse(n)}catch{}else F(n)?n=+n:n==="true"?n=!0:n==="false"&&(n=!1);r({...y,data:n})}else r(y)},s),this}removeEventListener(e,r,s){return this.off(e,r,s),this}close(){return this.ws.close(),this}};var ae=["get","post","put","delete","patch","options","head","connect","subscribe"],G=["localhost","127.0.0.1","0.0.0.0"],D=typeof FileList>"u",ie=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,oe=/(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{2}\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT(?:\+|-)\d{4}\s\([^)]+\)/,ce=/^(?:(?:(?:(?:0?[1-9]|[12][0-9]|3[01])[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:19|20)\d{2})|(?:(?:19|20)\d{2}[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:0?[1-9]|[12][0-9]|3[01]))))(?:\s(?:1[012]|0?[1-9]):[0-5][0-9](?::[0-5][0-9])?(?:\s[AP]M)?)?$/,_=t=>D?t instanceof Blob:t instanceof FileList||t instanceof File,fe=t=>{if(!t)return!1;for(let e in t)if(_(t[e])||Array.isArray(t[e])&&t[e].find(_))return!0;return!1},q=t=>D?t:new Promise(e=>{let r=new FileReader;r.onload=()=>{let s=new File([r.result],t.name,{lastModified:t.lastModified,type:t.type});e(s)},r.readAsArrayBuffer(t)}),K=(t,e,r=[],s)=>new Proxy(()=>{},{get(y,n){return K(t,e,n==="index"?r:[...r,n],s)},apply(y,n,[c,p]){if(!c||p||typeof c=="object"&&Object.keys(c).length!==1||ae.includes(r.at(-1))){let L=[...r],A=L.pop(),E="/"+L.join("/"),{fetcher:u=fetch,headers:a,onRequest:b,onResponse:T,fetch:R}=e,O=A==="get"||A==="head"||A==="subscribe";a={...typeof a=="object"&&!Array.isArray(a)?a:{},...O?c?.headers:p?.headers};let $=O?c?.query:p?.query,w="";if($)for(let[h,o]of Object.entries($))w+=(w?"&":"?")+`${h}=${o}`;if(typeof e.headers=="function"&&!(a instanceof Headers)){let h=e.headers(E,p??{});h&&(a={...a,...h})}else if(Array.isArray(e.headers)&&e.headers.every(h=>typeof h=="function"))for(let h of e.headers){let o=h(E,p??{});o&&(a={...a,...o})}else if(a instanceof Headers){a||(a={});for(let[h,o]of Object.entries(a))a[h]=o}if(A==="subscribe"){let h=t.replace(/^([^]+):\/\//,t.startsWith("https://")?"wss://":t.startsWith("http://")||G.find(o=>t.includes(o))?"ws://":"wss://")+E+w;return new C(h)}return(async()=>{let h=(a instanceof Headers?a.get("content-type"):Array.isArray(a)?a.find(i=>Array.isArray(i)&&i[0]==="headers"?i[1]:!1):typeof a=="function"?a(E,p??{}):a?.["content-type"])||p?.headers?.["content-type"],o={method:A?.toUpperCase(),body:c,...R,headers:{...a,"content-type":h}};if(O&&delete o.body,b){Array.isArray(b)||(b=[b]);for(let i of b){let f=await i(E,o);typeof f=="object"&&(o={...o,...f,headers:{...o.headers,...f.headers}})}}if(typeof o.body=="object")o.headers["content-type"]="application/json",o.body=JSON.stringify(o.body);else if(fe(o.body)){let i=new FormData;for(let[f,m]of Object.entries(o.body)){if(D){i.append(f,m);continue}if(m instanceof File){i.append(f,await q(m));continue}if(m instanceof FileList){for(let l=0;l<m.length;l++)i.append(f,await q(m[l]));continue}if(Array.isArray(m)){for(let l=0;l<m.length;l++){let v=m[l];i.append(f,v instanceof File?await q(v):v)}continue}i.append(f,m)}o.body=i}else o.body!==void 0&&(o.headers["content-type"]="text/plain");let N=t+E+w,d=await(s?.handle(new Request(N,o))??u(N,o)),S=null,g=null;if(T){Array.isArray(T)||(T=[T]);for(let i of T)try{let f=await i(d.clone());if(f!=null){S=f;break}}catch(f){f instanceof x?g=f:g=new x(422,f);break}}if(S===null){switch(d.headers.get("Content-Type")?.split(";")[0]){case"application/json":S=await d.json();break;case"application/octet-stream":S=await d.arrayBuffer();break;default:S=await d.text().then(i=>{if(F(i))return+i;if(i==="true")return!0;if(i==="false")return!1;if(!i)return i;let f=i.replace(/"/g,"");if(ie.test(f)||oe.test(f)||ce.test(f)){let m=new Date(f);if(!Number.isNaN(m.getTime()))return m}return i})}(d.status>=300||d.status<200)&&(g=new x(d.status,S),S=null)}return{data:S,error:g,response:d,status:d.status,headers:d.headers}})()}return typeof c=="object"?K(t,e,[...r,Object.values(c)[0]],s):K(t,e,r)}}),Z=(t,e={})=>typeof t=="string"?(e.keepDomain||(t.includes("://")||(t=(G.find(r=>t.includes(r))?"http://":"https://")+t),t.endsWith("/")&&(t=t.slice(0,-1))),K(t,e)):(typeof window<"u"&&console.warn("Elysia instance server found on client side, this is not recommended for security reason. Use generic type instead."),K("http://e.ly",e,[],t));var U=typeof FileList>"u",V=t=>U?t instanceof Blob:t instanceof FileList||t instanceof File,ye=t=>{if(!t)return!1;for(let e in t){if(V(t[e]))return!0;if(Array.isArray(t[e])&&t[e].find(r=>V(r)))return!0}return!1},J=t=>U?t:new Promise(e=>{let r=new FileReader;r.onload=()=>{let s=new File([r.result],t.name,{lastModified:t.lastModified,type:t.type});e(s)},r.readAsArrayBuffer(t)}),H=class{ws;url;constructor(e){this.ws=new WebSocket(e),this.url=e}send(e){return Array.isArray(e)?(e.forEach(r=>this.send(r)),this):(this.ws.send(typeof e=="object"?JSON.stringify(e):e.toString()),this)}on(e,r,s){return this.addEventListener(e,r,s)}off(e,r,s){return this.ws.removeEventListener(e,r,s),this}subscribe(e,r){return this.addEventListener("message",e,r)}addEventListener(e,r,s){return this.ws.addEventListener(e,y=>{if(e==="message"){let n=y.data.toString(),c=n.charCodeAt(0);if(c===47||c===123)try{n=JSON.parse(n)}catch{}else F(n)?n=+n:n==="true"?n=!0:n==="false"&&(n=!1);r({...y,data:n})}else r(y)},s),this}removeEventListener(e,r,s){return this.off(e,r,s),this}close(){return this.ws.close(),this}},z=(t,e="",r)=>new Proxy(()=>{},{get(s,y,n){return z(t,`${e}/${y.toString()}`,r)},apply(s,y,[n,c={}]=[{},{}]){let p=n!==void 0&&(typeof n!="object"||Array.isArray(n))?n:void 0,{$query:L,$fetch:A,$headers:E,$transform:u,getRaw:a,...b}=n??{};p??=b;let T=e.lastIndexOf("/"),R=e.slice(T+1).toUpperCase(),O=B(t,T===-1?"/":e.slice(0,T),Object.assign(c.query??{},L)),$=r.fetcher??fetch,w=r.transform?Array.isArray(r.transform)?r.transform:[r.transform]:void 0,h=u?Array.isArray(u)?u:[u]:void 0;return h&&(w?w=h.concat(w):w=h),R==="SUBSCRIBE"?new H(O.replace(/^([^]+):\/\//,O.startsWith("https://")?"wss://":"ws://")):(async N=>{let d,S={...r.$fetch?.headers,...A?.headers,...c.headers,...E};if(R!=="GET"&&R!=="HEAD"){d=Object.keys(p).length||Array.isArray(p)?p:void 0;let l=d&&(typeof d=="object"||Array.isArray(p));if(l&&ye(d)){let j=new FormData;for(let[M,k]of Object.entries(d))if(U)j.append(M,k);else if(k instanceof File)j.append(M,await J(k));else if(k instanceof FileList)for(let W=0;W<k.length;W++)j.append(M,await J(k[W]));else if(Array.isArray(k))for(let W=0;W<k.length;W++){let P=k[W];j.append(M,P instanceof File?await J(P):P)}else j.append(M,k);d=j}else d!=null&&(S["content-type"]=l?"application/json":"text/plain",d=l?JSON.stringify(d):p)}let g=await $(O,{method:R,body:d,...r.$fetch,...c.fetch,...A,headers:S}),i;if(N.getRaw)return g;switch(g.headers.get("Content-Type")?.split(";")[0]){case"application/json":i=await g.json();break;default:i=await g.text().then(l=>F(l)?+l:l==="true"?!0:l==="false"?!1:l)}let f=g.status>=300||g.status<200?new x(g.status,i):null,m={data:i,error:f,response:g,status:g.status,headers:g.headers};if(w)for(let l of w){let v=l(m);v instanceof Promise&&(v=await v),v!=null&&(m=v)}return m})({getRaw:a})}}),Q=(t,e={fetcher:fetch})=>new Proxy({},{get(r,s){return z(t,s,e)}});var X=(t,e)=>(r,{query:s,params:y,body:n,...c}={})=>{y&&Object.entries(y).forEach(([u,a])=>{r=r.replace(`:${u}`,a)});let p=c.headers?.["Content-Type"];if(!p||p==="application/json")try{n=JSON.stringify(n)}catch{}let L=e?.fetcher||globalThis.fetch,A=s?`?${new URLSearchParams(s).toString()}`:"",E=()=>L(t+r+A,{...c,method:c.method?.toUpperCase()||"GET",headers:n?{"content-type":"application/json",...c.headers}:c.headers,body:n}).then(async u=>{let a;switch(u.headers.get("Content-Type")?.split(";")[0]){case"application/json":a=await u.json();break;default:a=await u.text().then(b=>F(b)?parseInt(b):b==="true"?!0:b==="false"?!1:b);break}return u.status>300?{data:null,status:u.status,headers:u.headers,retry:E,error:new x(u.status,a)}:{data:a,error:null,status:u.status,headers:u.headers,retry:E}});return E()};0&&(module.exports={edenFetch,edenTreaty,treaty});
{
"name": "@elysiajs/eden",
"version": "1.0.8",
"version": "1.0.9",
"description": "Fully type-safe Elysia client",

@@ -5,0 +5,0 @@ "author": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc