@@ -142,7 +142,7 @@ const libXDom = {
142142 hasClass ( elems : LibXElems , className : string ) : boolean {
143143 // Returns true if any of the elements in the given list have the specified class.
144144 const elemHas = ( elem : Element ) => elem . classList . contains ( className ) ;
145- return ! ! Array . prototype . some . call ( elems , elemHas ) ;
145+ return Array . prototype . some . call ( elems , elemHas ) ;
146146 } ,
147147 toggleClass ( elem : Element , className : string , state ?: boolean ) : Element {
148148 // Adds or removes an element class.
@@ -211,12 +211,12 @@ const libXDom = {
211211 } ,
212212 indexOf ( elems : LibXElems , elem : Element ) : number {
213213 // Returns the location an element within an array of elements.
214- return Number ( Array . prototype . indexOf . call ( elems , elem ) ) ;
214+ return Array . prototype . indexOf . call ( elems , elem ) ;
215215 } ,
216216 findIndex ( elems : LibXElems , selector : string ) : number {
217217 // Returns the location of the first matching element within an array of elements.
218218 const elemMatches = ( elem : Element ) => elem . matches ( selector ) ;
219- return Number ( Array . prototype . findIndex . call ( elems , elemMatches ) ) ;
219+ return Array . prototype . findIndex . call ( elems , elemMatches ) ;
220220 } ,
221221 isElem ( elem : unknown ) : boolean {
222222 return ! ! elem && typeof elem === 'object' && ! ! ( < Element > elem ) . nodeName ;
@@ -656,24 +656,25 @@ const libXUi = {
656656 style . opacity = '0' ;
657657 if ( globalThis . getComputedStyle ( elem ) . display === 'none' )
658658 style . display = 'block' ;
659- const load = ( done : ( elem : Element ) => void ) => {
659+ const load = ( done : ( returnElem : Element ) => void ) => {
660+ console . log ( )
660661 const cleanup = ( ) => {
661662 style . removeProperty ( 'transition' ) ;
662663 style . removeProperty ( 'opacity' ) ;
663664 done ( elem ) ;
664665 } ;
665666 const handleImgage = ( ) => {
666667 if ( elem . matches ( 'img' ) )
667- ( < HTMLImageElement > elem ) . src = url ;
668+ ( < HTMLImageElement > elem ) . src = url ; //eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion
668669 else
669670 style . backgroundImage = 'url("' + url + '")' ;
670671 style . transition = `all ${ fadeTransition } ms` ;
671672 style . opacity = '1' ;
672673 globalThis . setTimeout ( cleanup , fadeTransition + 100 ) ;
673674 } ;
674- const img = new Image ( ) ;
675- img . onload = handleImgage ;
676- img . src = url ;
675+ const imgCache = new Image ( ) ;
676+ imgCache . onload = handleImgage ;
677+ imgCache . src = url ;
677678 } ;
678679 return new Promise ( resolve => load ( resolve ) ) ;
679680 } ,
@@ -838,7 +839,7 @@ const libXBrowser = {
838839 const polyfill = ( ) : NavigatorUAData => {
839840 const brandEntry = globalThis . navigator . userAgent . split ( ' ' ) . pop ( ) ?. split ( '/' ) ?? [ ] ;
840841 const hasTouch = ! ! navigator . maxTouchPoints ;
841- const platform = globalThis . navigator . platform ; //eslint-disable-line @typescript-eslint/no-deprecated
842+ const platform = globalThis . navigator . platform ;
842843 const mac = hasTouch ? 'iOS' : 'macOS' ;
843844 const platforms : { [ platform : string ] : string } =
844845 { 'MacIntel' : mac , 'Win32' : 'Windows' , 'iPhone' : 'iOS' , 'iPad' : 'iOS' } ;
0 commit comments