You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any interest in adding support for a Boolean type? If you think this fits, I can PR it.
I implemented it like this:
functionencode(value,buffer,offset){if(typeofvalue!=='boolean')thrownewTypeError('value must be a boolean')if(!buffer)buffer=Buffer.allocUnsafe(1)if(!offset)offset=0buffer.writeUInt8(Number(value),offset)returnbuffer}functiondecode(buffer,offset,end){if(!offset)offset=0if(!end)returnBoolean(buffer.readUInt8(offset))returnBoolean(buffer.slice(offset,end).readUInt8(0))}functionencodingLength(){return1}encode.bytes=decode.bytes=1exportconstVBoolean={
encode,
decode,
encodingLength
}
The text was updated successfully, but these errors were encountered:
Is there any interest in adding support for a
Boolean
type? If you think this fits, I can PR it.I implemented it like this:
The text was updated successfully, but these errors were encountered: