File tree Expand file tree Collapse file tree 3 files changed +16
-25
lines changed Expand file tree Collapse file tree 3 files changed +16
-25
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,8 @@ export function nodeFromJSON(
70
70
const children : NamedNode [ ] = [ ] ;
71
71
let childrenHavePriority = false ;
72
72
const hinzeJsonObj : { [ k : string ] : any } = json ;
73
- each ( hinzeJsonObj , ( key : string , child : any ) => {
74
- if ( typeof key !== 'string' || key . substring ( 0 , 1 ) !== '.' ) {
73
+ each ( hinzeJsonObj , ( key , child ) => {
74
+ if ( key . substring ( 0 , 1 ) !== '.' ) {
75
75
// Ignore metadata nodes
76
76
const childNode = nodeFromJSON ( child ) ;
77
77
if ( ! childNode . isEmpty ( ) ) {
Original file line number Diff line number Diff line change @@ -394,22 +394,16 @@ export const splitStringBySize = function(
394
394
* @param obj The object or array to iterate over
395
395
* @param fn The function to apply
396
396
*/
397
- export function each ( obj : object | Array < any > , fn : ( v : any , k : any ) => void ) {
398
- if ( Array . isArray ( obj ) ) {
399
- for ( let i = 0 ; i < obj . length ; ++ i ) {
400
- fn ( i , obj [ i ] ) ;
401
- }
402
- } else {
403
- /**
404
- * in the conversion of code we removed the goog.object.forEach
405
- * function which did a value,key callback. We standardized on
406
- * a single impl that does a key, value callback. So we invert
407
- * to not have to touch the `each` code points
408
- */
409
- for ( const key in obj ) {
410
- if ( obj . hasOwnProperty ( key ) ) {
411
- fn ( obj [ key ] , key ) ;
412
- }
397
+ export function each ( obj : object , fn : ( k : string , v : any ) => void ) {
398
+ /**
399
+ * in the conversion of code we removed the goog.object.forEach
400
+ * function which did a value,key callback. We standardized on
401
+ * a single impl that does a key, value callback. So we invert
402
+ * to not have to touch the `each` code points
403
+ */
404
+ for ( const key in obj ) {
405
+ if ( obj . hasOwnProperty ( key ) ) {
406
+ fn ( key , obj [ key ] ) ;
413
407
}
414
408
}
415
409
}
Original file line number Diff line number Diff line change @@ -70,14 +70,11 @@ export class TransportManager {
70
70
this . transports_ = [ WebSocketConnection ] ;
71
71
} else {
72
72
const transports = ( this . transports_ = [ ] as TransportConstructor [ ] ) ;
73
- each (
74
- TransportManager . ALL_TRANSPORTS ,
75
- ( i : number , transport : TransportConstructor ) => {
76
- if ( transport && transport [ 'isAvailable' ] ( ) ) {
77
- transports . push ( transport ) ;
78
- }
73
+ for ( const transport of TransportManager . ALL_TRANSPORTS ) {
74
+ if ( transport && transport [ 'isAvailable' ] ( ) ) {
75
+ transports . push ( transport ) ;
79
76
}
80
- ) ;
77
+ }
81
78
}
82
79
}
83
80
You can’t perform that action at this time.
0 commit comments