flumedb / flumelog-offset

MIT License
10 stars 8 forks source link

inaccurate codec default #7

Closed mixmix closed 4 years ago

mixmix commented 6 years ago

README:

  codec: {encode, decode} // defaults to a json codec

CODE:

function id (e) { return e }
...

  var codec = opts.codec || {encode: id, decode: id}
mixmix commented 6 years ago

I think the JSON encoding as defualt would be nice, because I just tried relying on that nice sounding default and it would make my first time flumelog-offset setup simple ...

dominictarr commented 6 years ago

this is technically a breaking change, but since this is a new module being pretty actively developed it's okay to expect chaos. probably will have to change the tests, but hmm, this is one less roadbump for new users (in a js context) optimizers can still do binary whatever if they want. WOULD MERGE.

christianbundy commented 4 years ago

Is the right solution to fix the readme or fix the code? I don't have a strong opinion, I just know that I care lots about the readme's accuracy.

dominictarr commented 4 years ago

I fixed the readme, because that was easier.

dominictarr commented 4 years ago

Also, I've since changed my mind about json. The default behavior for a flumelog is really something we want to be standard across all flumelogs, (so we can have drop-in compatibility) and buffer is the lowest common denomenator.

dominictarr commented 4 years ago

fixed in 3.4.4