File tree 1 file changed +9
-10
lines changed
1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -695,23 +695,22 @@ export class SuperHeaders extends Headers {
695
695
* [HTTP/1.1 Specification](https://datatracker.ietf.org/doc/html/rfc6265#section-4.1)
696
696
*/
697
697
get setCookie ( ) : SetCookie [ ] {
698
- for ( let i = 0 ; i < this . #setCookies. length ; ++ i ) {
699
- let value = this . #setCookies[ i ] ;
700
- if ( typeof value === 'string' ) {
701
- this . #setCookies[ i ] = new SetCookie ( value ) ;
698
+ let setCookies = this . #setCookies;
699
+
700
+ for ( let i = 0 ; i < setCookies . length ; ++ i ) {
701
+ if ( typeof setCookies [ i ] === 'string' ) {
702
+ setCookies [ i ] = new SetCookie ( setCookies [ i ] ) ;
702
703
}
703
704
}
704
705
705
- return this . # setCookies as SetCookie [ ] ;
706
+ return setCookies as SetCookie [ ] ;
706
707
}
707
708
708
709
set setCookie ( value : ( string | SetCookieInit ) [ ] | string | SetCookieInit | undefined | null ) {
709
710
if ( value != null ) {
710
- if ( Array . isArray ( value ) ) {
711
- this . #setCookies = value . map ( ( v ) => ( typeof v === 'string' ? v : new SetCookie ( v ) ) ) ;
712
- } else {
713
- this . #setCookies = [ typeof value === 'string' ? value : new SetCookie ( value ) ] ;
714
- }
711
+ this . #setCookies = ( Array . isArray ( value ) ? value : [ value ] ) . map ( ( v ) =>
712
+ typeof v === 'string' ? v : new SetCookie ( v ) ,
713
+ ) ;
715
714
} else {
716
715
this . #setCookies = [ ] ;
717
716
}
You can’t perform that action at this time.
0 commit comments