You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'd swap the snippet for plain byte comparisons matching the is-gzip / is-deflate entries. the DataView+bigint version is correct on typed arrays (nice catch on byteOffset), but it throws on plain arrays where the package returns a boolean, allocates a DataView per call, and reads less obviously than eight hex compares. the boring version is also verbatim what the package ships
Activity
dreyfus92 commentedon Aug 28, 2026
i'd swap the snippet for plain byte comparisons matching the
is-gzip/is-deflateentries. the DataView+bigint version is correct on typed arrays (nice catch on byteOffset), but it throws on plain arrays where the package returns a boolean, allocates a DataView per call, and reads less obviously than eight hex compares. the boring version is also verbatim what the package shipsgameroman commentedon Aug 28, 2026
Yeah, looks like checking each byte is more efficient