Skip to content

Commit 2e385a8

Browse files
committed
Lint
1 parent a1ea23e commit 2e385a8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/nifti.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,24 @@ export function decompress(data: ArrayBuffer) {
115115
* @returns {Promise<ArrayBuffer>}
116116
*/
117117
export async function decompressAsync(data: ArrayBuffer) {
118-
const uint8Data = new Uint8Array(data);
118+
const uint8Data = new Uint8Array(data)
119119
const format = uint8Data[0] === 31 && uint8Data[1] === 139 && uint8Data[2] === 8
120120
? 'gzip'
121121
: uint8Data[0] === 120 && (uint8Data[1] === 1 || uint8Data[1] === 94 || uint8Data[1] === 156 || uint8Data[1] === 218)
122122
? 'deflate'
123-
: 'deflate-raw';
123+
: 'deflate-raw'
124124

125-
const stream = new DecompressionStream(format);
126-
const writer = stream.writable.getWriter();
127-
writer.write(uint8Data).catch(console.error); // Do not await this
125+
const stream = new DecompressionStream(format)
126+
const writer = stream.writable.getWriter()
127+
writer.write(uint8Data).catch(console.error) // Do not await this
128128

129129
// Close without awaiting directly, preventing the hang issue
130-
const closePromise = writer.close().catch(console.error);
131-
const response = new Response(stream.readable);
132-
const result = await response.arrayBuffer(); // Return ArrayBuffer instead of Uint8Array
130+
const closePromise = writer.close().catch(console.error)
131+
const response = new Response(stream.readable)
132+
const result = await response.arrayBuffer() // Return ArrayBuffer instead of Uint8Array
133133

134-
await closePromise; // Ensure close happens eventually
135-
return result;
134+
await closePromise // Ensure close happens eventually
135+
return result
136136
}
137137

138138
/**

0 commit comments

Comments
 (0)