Closed ghost closed 1 year ago
Given that there is buffer.skip() would it be worth to have a buffer.back(n) ?
buffer.skip()
buffer.back(n)
I was just writing (sorry for the example)
buffer.offset -= 4;//back from parameter reading const sequences = buffer.readUint16(); buffer.skip(2) //now skip the parameters
And wondered about it. I am aware that skip(-2) should do, but it may not be semantically that useful.
adding buffer.back(n) sgtm. would you like to make a PR?
Yes, I'll try.
Given that there is
buffer.skip()
would it be worth to have abuffer.back(n)
?I was just writing (sorry for the example)
And wondered about it. I am aware that skip(-2) should do, but it may not be semantically that useful.