File tree Expand file tree Collapse file tree 5 files changed +10
-8
lines changed Expand file tree Collapse file tree 5 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import * as urls from '../utils/urls'
33
44export class BaseSiteComponent {
55 protected session ?: session . Session ;
6- constructor ( params : session . Session | undefined | {
6+ constructor ( params ? : session . Session | {
77 session ?: session . Session
88 } ) {
99 if ( params instanceof session . Session || params === undefined ) {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export class PartialProject extends base.BaseSiteComponent {
2323 params . id = 0 ;
2424 }
2525
26- super ( { session : params . session } ) ;
26+ super ( params . session ) ;
2727
2828 this . id = params . id ;
2929 this . title = params . title ;
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export class Session extends base.BaseSiteComponent{
3838 params . password = '' ;
3939 }
4040
41- super ( { } ) ;
41+ super ( ) ;
4242 this . session = this ;
4343
4444 this . id = params . id ;
@@ -115,9 +115,11 @@ export class Session extends base.BaseSiteComponent{
115115export function decode_session_id ( session_id : string ) : [ Record < string , string > , Date ] {
116116 const [ p1 , p2 ] = session_id . split ( ':' ) ;
117117
118+ expect ( p2 ) . toBeDefined ( ) ;
119+
118120 return [
119121 JSON . parse ( zlib . inflateSync ( Buffer . from ( p1 + '==' , 'base64url' ) ) . toString ( ) ) ,
120- new Date ( commons . b62_decode ( p2 ) * 1000 )
122+ new Date ( commons . b62_decode ( p2 ! ) * 1000 )
121123 ] ;
122124}
123125
Original file line number Diff line number Diff line change @@ -4,15 +4,15 @@ import * as session from './session';
44import * as urls from '../utils/urls'
55
66export class User extends base . BaseSiteComponent {
7- id ? : number ;
8- name ? : string ;
7+ id : number | undefined ;
8+ name : string | undefined ;
99
1010 constructor ( params : {
1111 name ?: string ;
1212 id ?: number ;
1313 session ?: session . Session
1414 } ) {
15- super ( { session : params . session } ) ;
15+ super ( params . session ) ;
1616
1717 this . id = params . id ;
1818 this . name = params . name ;
Original file line number Diff line number Diff line change 2525
2626 // Stricter Typechecking Options
2727 "noUncheckedIndexedAccess" : true ,
28- "exactOptionalPropertyTypes" : true ,
28+ "exactOptionalPropertyTypes" : false ,
2929
3030 // Style Options
3131 // "noImplicitReturns": true,
You can’t perform that action at this time.
0 commit comments