rvagg/node-levelup — pull request #233 by dominictarr (2014-03-18 23:21:28+00:00)
Title: refactor to make encoding strategies injectable

This change makes it possible to inject encoding functions.
(the `encodeKey, encodeValue, decodeKey, decodeValue, keyAsBuffer, valueAsBuffer` functions from util have all be extracted out into their own module and that is passed into `LevelUP`, `Batch`, and `ReadStream` instances.

I need this so that I can reuse all the levelup code in level-sublevel - I'll basically only have to handle hooks and encoding - and will be able to inherit from levelup and not need to do any monkey patching.

I havn't touched write-stream, as that is due to be removed.
also, I'd like to handle `lt, gt, lte, gte` but I'll make that a separate pull request as this is enough to get a discussion going.

All the tests are still the same and pass, except for `test/init-test.js` which failed for me on master.