File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11import ironStore from "iron-store" ;
22import cookie from "cookie" ;
33import createDebug from "debug" ;
4+ import flat from "array.prototype.flat" ;
45
56const debug = createDebug ( "next-iron-session" ) ;
67
@@ -67,7 +68,7 @@ export async function applySession(
6768 `next-iron-session: Cookie length is too big ${ cookieValue . length } , browsers will refuse it` ,
6869 ) ;
6970 }
70- const existingSetCookie = [ res . getHeader ( "set-cookie" ) || [ ] ] . flat ( ) ;
71+ const existingSetCookie = flat ( [ res . getHeader ( "set-cookie" ) || [ ] ] ) ;
7172 res . setHeader ( "set-cookie" , [ ...existingSetCookie , cookieValue ] ) ;
7273 return cookieValue ;
7374 } ,
@@ -77,7 +78,7 @@ export async function applySession(
7778 ...cookieOptions ,
7879 maxAge : 0 ,
7980 } ) ;
80- const existingSetCookie = [ res . getHeader ( "set-cookie" ) || [ ] ] . flat ( ) ;
81+ const existingSetCookie = flat ( [ res . getHeader ( "set-cookie" ) || [ ] ] ) ;
8182 res . setHeader ( "set-cookie" , [ ...existingSetCookie , cookieValue ] ) ;
8283 } ,
8384 } ;
Original file line number Diff line number Diff line change 3232 {
3333 "targets" : {
3434 "node" : " 10"
35- },
36- "useBuiltIns" : " usage" ,
37- "corejs" : 3
35+ }
3836 }
3937 ]
4038 ]
8179 ]
8280 },
8381 "dependencies" : {
82+ "array.prototype.flat" : " ^1.2.3" ,
8483 "clone" : " ^2.1.2" ,
8584 "cookie" : " ^0.4.1" ,
8685 "debug" : " ^4.1.1" ,
You can’t perform that action at this time.
0 commit comments