nodeca/pako — pull request #18 by devongovett (2014-04-07 17:09:51+00:00)
Title: Fix arraySet where the dest is a Node buffer

I'm using the zstream interface directly instead of the inflate/deflate wrappers. Basically, I'm building a Node API compatible wrapper for use in browserify. If `strm.next_out` is set to a Node Buffer (or a browserify one) and typed arrays are present, `utils.arraySet` breaks. This is because the source buffer might be a typed array still so the test whether to use the typed array's subarray still passes, but the dest isn't a typed array so it breaks.

This just does a quick check to see if buffers are present and whether the dest is a buffer, and falls back to the normal loop copy if so.