Skip to content

v0.1.1

Pre-release
Pre-release

Choose a tag to compare

@Conaclos Conaclos released this 09 Jan 16:44
· 91 commits to main since this release
58ddacd
  • Fix write offset when byteOffset > 0

    A ByteCursor may be instantiated with an array of bytes such that
    the array's byteOffset is greater than 0.
    The previous ByteCursor.write implementation did not take care of adding this byteOffset to the ByteCursor's offset.

    The following code no longer fail:

    const bytes = Uint8Array.of(42, 24).subarray(1)
    assert(bytes.byteOffset === 1)
    
    const bc = ByteCursor(bytes, ...)
    bc.write(Uint8Array.of(24))
    assert.deepEqual(Array.from(bytes), [42, 24]) // Previously failed
  • Smaller CommonJS bundle

  • Improve byte-length computation of small string