@@ -296,7 +296,7 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor, iterator: boo
296
296
}
297
297
else {
298
298
const types = obj . type . map ( convertDomTypeToTsTypeWorker ) ;
299
- const isAny = types . find ( t => t . name === "any" ) ;
299
+ const isAny = types . some ( t => t . name === "any" ) ;
300
300
if ( isAny ) {
301
301
type = {
302
302
name : "any" ,
@@ -306,7 +306,7 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor, iterator: boo
306
306
else {
307
307
type = {
308
308
name : types . map ( t => t . name ) . join ( " | " ) ,
309
- nullable : ! ! types . find ( t => t . nullable ) || ! ! obj . nullable
309
+ nullable : types . some ( t => t . nullable ) || ! ! obj . nullable
310
310
} ;
311
311
}
312
312
}
@@ -590,9 +590,9 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor, iterator: boo
590
590
function isCovariantEventHandler ( i : Browser . Interface , p : Browser . Property ) {
591
591
return isEventHandler ( p ) &&
592
592
iNameToEhParents [ i . name ] && iNameToEhParents [ i . name ] . length > 0 &&
593
- ! ! iNameToEhParents [ i . name ] . find (
593
+ iNameToEhParents [ i . name ] . some (
594
594
i => iNameToEhList [ i . name ] && iNameToEhList [ i . name ] . length > 0 &&
595
- ! ! iNameToEhList [ i . name ] . find ( e => e . name === p . name ) ) ;
595
+ iNameToEhList [ i . name ] . some ( e => e . name === p . name ) ) ;
596
596
}
597
597
598
598
function emitProperty ( prefix : string , i : Browser . Interface , emitScope : EmitScope , p : Browser . Property ) {
@@ -990,8 +990,8 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor, iterator: boo
990
990
// Some types are static types with non-static members. For example,
991
991
// NodeFilter is a static method itself, however it has an "acceptNode" method
992
992
// that expects the user to implement.
993
- const hasNonStaticMethod = i . methods && ! ! mapToArray ( i . methods . method ) . find ( m => ! m . static ) ;
994
- const hasProperty = i . properties && mapToArray ( i . properties . property ) . find ( p => ! p . static ) ;
993
+ const hasNonStaticMethod = i . methods && mapToArray ( i . methods . method ) . some ( m => ! m . static ) ;
994
+ const hasProperty = i . properties && mapToArray ( i . properties . property ) . some ( p => ! p . static ) ;
995
995
const hasNonStaticMember = hasNonStaticMethod || hasProperty ;
996
996
997
997
// For static types with non-static members, we put the non-static members into an
0 commit comments