@@ -152,13 +152,10 @@ class App extends PDFObject {
152152 }
153153
154154 static _getLanguage ( language ) {
155- const [ main , sub ] = language . toLowerCase ( ) . split ( / [ - _ ] / ) ;
155+ const [ main , sub ] = language . toLowerCase ( ) . split ( / [ - _ ] / , 2 ) ;
156156 switch ( main ) {
157157 case "zh" :
158- if ( sub === "cn" || sub === "sg" ) {
159- return "CHS" ;
160- }
161- return "CHT" ;
158+ return sub === "cn" || sub === "sg" ? "CHS" : "CHT" ;
162159 case "da" :
163160 return "DAN" ;
164161 case "de" :
@@ -178,10 +175,7 @@ class App extends PDFObject {
178175 case "no" :
179176 return "NOR" ;
180177 case "pt" :
181- if ( sub === "br" ) {
182- return "PTB" ;
183- }
184- return "ENU" ;
178+ return sub === "br" ? "PTB" : "ENU" ;
185179 case "fi" :
186180 return "SUO" ;
187181 case "SV" :
@@ -249,13 +243,10 @@ class App extends PDFObject {
249243 }
250244
251245 get fs ( ) {
252- if ( this . _fs === null ) {
253- this . _fs = new Proxy (
254- new FullScreen ( { send : this . _send } ) ,
255- this . _proxyHandler
256- ) ;
257- }
258- return this . _fs ;
246+ return ( this . _fs ??= new Proxy (
247+ new FullScreen ( { send : this . _send } ) ,
248+ this . _proxyHandler
249+ ) ) ;
259250 }
260251
261252 set fs ( _ ) {
@@ -356,13 +347,10 @@ class App extends PDFObject {
356347 }
357348
358349 get thermometer ( ) {
359- if ( this . _thermometer === null ) {
360- this . _thermometer = new Proxy (
361- new Thermometer ( { send : this . _send } ) ,
362- this . _proxyHandler
363- ) ;
364- }
365- return this . _thermometer ;
350+ return ( this . _thermometer ??= new Proxy (
351+ new Thermometer ( { send : this . _send } ) ,
352+ this . _proxyHandler
353+ ) ) ;
366354 }
367355
368356 set thermometer ( _ ) {
0 commit comments