zhipeng-jia / snappyjs

JavaScript implementation of Google's Snappy compression library
MIT License
151 stars 30 forks source link

Add support for input type `Uint8Array` #1

Closed KlausTrainer closed 8 years ago

KlausTrainer commented 8 years ago

Currently, if the input type is Uint8Array, one needs to convert, or one needs to leave the input unconverted, depending on the platform.

One particular problem is that in Node, input instanceof Uint8Array is true both when input is of type Uint8Array and Buffer, but those two still need to be treated differently.

With this change, users don't have to bother with detecting the platform and converting the input anymore when input instanceof Uint8Array === true.

zhipeng-jia commented 8 years ago

Thanks for your contribution!

KlausTrainer commented 8 years ago

Thank you! Would you mind pushing a new release?

zhipeng-jia commented 8 years ago

I have done it!

KlausTrainer commented 8 years ago

Great! Thanks :)