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
Currently the writeOffset is always adjusted and readOffset is never adjusted.
I think a more sensible thing is to adjust both, but not if the insertion offset is after them.
import { SmartBuffer as SB } from 'smart-buffer';
console.log(SB.fromBuffer(Buffer.from('abcd')).insertString('XX', 0).writeOffset); // 2 - ok
console.log(SB.fromBuffer(Buffer.from('abcd')).insertString('XX', 1).writeOffset); // 2 - should be 0
console.log(SB.fromBuffer(Buffer.from('abcd')).insertString('XX', 0).readOffset); // 0 - should be 2
console.log(SB.fromBuffer(Buffer.from('abcd')).insertString('XX', 1).readOffset); // 0 - ok
The text was updated successfully, but these errors were encountered:
Currently the
writeOffset
is always adjusted andreadOffset
is never adjusted.I think a more sensible thing is to adjust both, but not if the insertion offset is after them.
The text was updated successfully, but these errors were encountered: