damn @arj beat me to it (and I didn't see because of replication delays!)
following this down I was I got to looking at that minimal.js too
var codec = {
encode: function (obj) {
return JSON.stringify(obj, null, 2)
},
decode: function (str) {
return unbox(JSON.parse(str.toString()), unboxers)
},
buffer: false, //// << watch this value
type: 'ssb'
}
var log = OffsetLog(path.join(dirname, 'log.offset'), {blockSize:1024*16, codec:codec})
diving into flumelog-offset/inject.js
(where this codec object is used) :
var data = {
value: codec.decode(codec.buffer ? value : value.toString()),
prev: prev,
next: next
}
I didn't dig further to check that value
is a Buffer...
but seems like arj is correct value -> toString -> toString() -> JSON.parse -> unbox
(toString twice!)