@@ -15,7 +15,7 @@ const MaxInputSize = 512 * 1024
1515// This queue is for async `fs` operations, to avoid reaching file-descriptor limits
1616const queue = new Queue ( { concurrency : 100 , autostart : true } )
1717
18- type Options = {
18+ interface Options {
1919 disabledFS : boolean
2020 disabledTypes : imageType [ ]
2121}
@@ -53,7 +53,7 @@ function lookup(input: Uint8Array, filepath?: string): ISizeCalculationResult {
5353
5454 // throw up, if we don't understand the file
5555 throw new TypeError (
56- 'unsupported file type: ' + type + ' (file: ' + filepath + ')'
56+ 'unsupported file type: ' + type + ' (file: ' + filepath + ')' ,
5757 )
5858}
5959
@@ -114,8 +114,8 @@ export function imageSize(input: string, callback: CallbackFn): void
114114 */
115115export function imageSize (
116116 input : Uint8Array | string ,
117- callback ?: CallbackFn
118- ) : ISizeCalculationResult | void {
117+ callback ?: CallbackFn ,
118+ ) : ISizeCalculationResult | undefined {
119119 // Handle Uint8Array input
120120 if ( input instanceof Uint8Array ) {
121121 return lookup ( input )
@@ -132,9 +132,9 @@ export function imageSize(
132132 queue . push ( ( ) =>
133133 readFileAsync ( filepath )
134134 . then ( ( input ) =>
135- process . nextTick ( callback , null , lookup ( input , filepath ) )
135+ process . nextTick ( callback , null , lookup ( input , filepath ) ) ,
136136 )
137- . catch ( callback )
137+ . catch ( callback ) ,
138138 )
139139 } else {
140140 const input = readFileSync ( filepath )
0 commit comments