Skip to content

Commit

Permalink
fix: close the test compression stream (#1865)
Browse files Browse the repository at this point in the history
  • Loading branch information
inverted-capital committed Feb 18, 2024
1 parent 6170171 commit 79a38e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/deflate.js
Expand Up @@ -22,12 +22,12 @@ async function browserDeflate(buffer) {
function testCompressionStream() {
try {
const cs = new CompressionStream('deflate')
cs.writable.close()
// Test if `Blob.stream` is present. React Native does not have the `stream` method
const stream = new Blob([]).stream()
stream.cancel()
return !!cs
return true
} catch (_) {
// no bother
return false
}
return false
}

0 comments on commit 79a38e0

Please sign in to comment.