Comparing version
@@ -11,3 +11,3 @@ import { SessionStorage, Session } from '@remix-run/node'; | ||
session: Session; | ||
key: string; | ||
name: string; | ||
value: any; | ||
@@ -19,12 +19,27 @@ }) => { | ||
session: Session; | ||
key: string; | ||
name: string; | ||
value: any; | ||
}; | ||
}; | ||
getSessionFlashData: (payload: { | ||
commitSession: SessionStorage['commitSession']; | ||
session: Session; | ||
name: string; | ||
}) => { | ||
type: "GET_SESSION_FLASH_DATA"; | ||
payload: { | ||
commitSession: SessionStorage['commitSession']; | ||
session: Session; | ||
name: string; | ||
}; | ||
}; | ||
}; | ||
declare const gen: (loaderOrActionGenFn: (args: { | ||
actions: typeof actions; | ||
}) => AsyncGenerator) => Promise<Response>; | ||
interface LoaderOrActionGenFn { | ||
(args: { | ||
actions: typeof actions; | ||
}): AsyncGenerator; | ||
} | ||
declare const gen: (loaderOrActionGenFn: LoaderOrActionGenFn) => Promise<Response>; | ||
export { gen }; |
@@ -1,2 +0,2 @@ | ||
var i={setCookieHeader:e=>({type:"SET_COOKIE_HEADER",payload:e}),flashSession:e=>({type:"FLASH_SESSION",payload:e})};function p(e){return typeof e=="object"&&e!==null&&Object.prototype.hasOwnProperty.call(e,"type")&&Object.prototype.hasOwnProperty.call(e,"payload")}var c=async(e,n)=>{let{type:s,payload:t}=n;switch(s){case"SET_COOKIE_HEADER":{e.headers.push(["Set-Cookie",t]);break}case"FLASH_SESSION":{let{commitSession:o,session:r,key:a,value:S}=t;r.flash(a,S),e.headers.push(["Set-Cookie",await o(r)]);break}}return e};var y=()=>({headers:[]});var w=async e=>{let n=e({actions:i}),s=await n.next(),t=y();for(;!s.done;)p(s.value)&&(t=await c(t,s.value)),s=await n.next();let o=s.value;return o instanceof Response?(o.headers.forEach((r,a)=>{t.headers.push([a,r])}),new Response(o.body,{...o,headers:new Headers(t.headers),status:o.status})):(t.headers.push(["Content-Type","application/json; charset=utf-8"]),new Response(JSON.stringify(o),{headers:new Headers(t.headers)}))};export{w as gen}; | ||
var c={setCookieHeader:e=>({type:"SET_COOKIE_HEADER",payload:e}),flashSession:e=>({type:"FLASH_SESSION",payload:e}),getSessionFlashData:e=>({type:"GET_SESSION_FLASH_DATA",payload:e})};function p(e){return typeof e=="object"&&e!==null&&Object.prototype.hasOwnProperty.call(e,"type")&&Object.prototype.hasOwnProperty.call(e,"payload")}var S=async(e,i)=>{let{type:s,payload:t}=i,a;switch(s){case"SET_COOKIE_HEADER":{e.headers.push(["Set-Cookie",t]);break}case"FLASH_SESSION":{let{commitSession:o,session:n,name:r,value:m}=t;n.flash(r,m),e.headers.push(["Set-Cookie",await o(n)]);break}case"GET_SESSION_FLASH_DATA":{let{commitSession:o,session:n,name:r}=t;a=n.get(r),e.headers.push(["Set-Cookie",await o(n)]);break}}return[e,a]};var y=()=>({headers:[]});var g=async e=>{let i=e({actions:c}),s=await i.next(),t=y(),a;for(;!s.done;)p(s.value)&&([t,a]=await S(t,s.value)),s=await i.next(a);let o=s.value;return o instanceof Response?(o.headers.forEach((n,r)=>{t.headers.push([r,n])}),new Response(o.body,{...o,headers:new Headers(t.headers),status:o.status})):(t.headers.push(["Content-Type","application/json; charset=utf-8"]),new Response(JSON.stringify(o),{headers:new Headers(t.headers)}))};export{g as gen}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "remix-gen", | ||
"version": "0.0.2", | ||
"packageManager": "yarn@3.2.1", | ||
"version": "0.0.3", | ||
"packageManager": "yarn@3.2.2", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "remix", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
17963
16.66%52
48.57%