Skip to content
forked from madler/zlib

Commit e0ad6c4

Browse files
committed
fix: convert SIMD capability check to boolean
C function _zlib_has_simd returns int, convert to boolean for TypeScript type safety
1 parent 63d3754 commit e0ad6c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ export default class Zlib {
277277
throw new ZlibError('zlib.wasm not initialized')
278278
}
279279

280-
// Check SIMD capabilities
281-
const simdSupported = this.module!._zlib_has_simd?.() ?? false
280+
// Check SIMD capabilities (C function returns int, convert to boolean)
281+
const simdSupported = (this.module!._zlib_has_simd?.() ?? 0) !== 0
282282

283283
// Get version string
284284
const versionPtr = this.module!._zlib_get_version?.()

0 commit comments

Comments
 (0)