@@ -270,10 +270,21 @@ export const isPrimitive = (type: string) => {
270
270
return primitives . indexOf ( type . toLowerCase ( ) . replace ( / \[ \] / g, '' ) ) !== - 1 ;
271
271
} ;
272
272
export const isBuiltIn = ( type : string ) => {
273
- const builtIns = [ 'promise' , 'buffer' , 'int8array' , 'uint8array' ,
274
- 'uint8clampedarray' , 'int16array' , 'uint16array' , 'int32array' ,
275
- 'uint32array' , 'float32array' , 'float64array' , 'bigint64array' ,
276
- 'biguint64array' ] ;
273
+ const builtIns = [
274
+ 'promise' ,
275
+ 'buffer' ,
276
+ 'int8array' ,
277
+ 'uint8array' ,
278
+ 'uint8clampedarray' ,
279
+ 'int16array' ,
280
+ 'uint16array' ,
281
+ 'int32array' ,
282
+ 'uint32array' ,
283
+ 'float32array' ,
284
+ 'float64array' ,
285
+ 'bigint64array' ,
286
+ 'biguint64array' ,
287
+ ] ;
277
288
return builtIns . indexOf ( type . toLowerCase ( ) . replace ( / \[ \] / g, '' ) ) !== - 1 ;
278
289
} ;
279
290
export const isOptional = ( param : { required ?: boolean ; name : string ; type : any } ) => {
@@ -318,18 +329,19 @@ export const genMethodString = (
318
329
return paramInterfaces . createParamInterface ( objectParam , _ . upperFirst ( moduleMethod . name ) ) ;
319
330
}
320
331
321
- if (
322
- [ 'set' , 'get' ] . includes (
323
- moduleMethod . name . toLowerCase ( ) ,
324
- )
325
- ) {
332
+ if ( [ 'set' , 'get' ] . includes ( moduleMethod . name . toLowerCase ( ) ) ) {
326
333
return paramInterfaces . createParamInterface (
327
334
objectParam ,
328
335
_ . upperFirst ( module . name ) + _ . upperFirst ( moduleMethod . name ) ,
329
336
) ;
330
337
}
331
338
332
- return paramInterfaces . createParamInterface ( objectParam , '' , _ . upperFirst ( moduleMethod . name ) , topLevelModuleMethod ? _ . upperFirst ( topLevelModuleMethod . name ) : '' ) ;
339
+ return paramInterfaces . createParamInterface (
340
+ objectParam ,
341
+ '' ,
342
+ _ . upperFirst ( moduleMethod . name ) ,
343
+ topLevelModuleMethod ? _ . upperFirst ( topLevelModuleMethod . name ) : '' ,
344
+ ) ;
333
345
} ;
334
346
return `${ includeType ? '(' : '' } ${ ( moduleMethod . parameters || [ ] )
335
347
. map ( param => {
@@ -360,7 +372,7 @@ export const genMethodString = (
360
372
} as any /* FIXME: */ ,
361
373
true ,
362
374
'' ,
363
- moduleMethod
375
+ moduleMethod ,
364
376
) ,
365
377
} ) ;
366
378
} else if ( paramType . type === 'Object' && objectParam . properties ) {
@@ -374,9 +386,14 @@ export const genMethodString = (
374
386
}
375
387
const functionParam = param as DetailedFunctionType ;
376
388
if ( param . type === 'Function' && functionParam . parameters ) {
377
- paramType = genMethodString ( paramInterfaces , module , functionParam as any /* FIXME: */ , true ,
389
+ paramType = genMethodString (
390
+ paramInterfaces ,
391
+ module ,
392
+ functionParam as any /* FIXME: */ ,
393
+ true ,
378
394
'' ,
379
- moduleMethod ) ;
395
+ moduleMethod ,
396
+ ) ;
380
397
}
381
398
382
399
const name = paramify ( param . name ) ;
0 commit comments