@bare-ts/lib 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codec/data.d.ts +4 -4
- package/dist/codec/data.js +16 -16
- package/dist/codec/float-array.d.ts +12 -12
- package/dist/codec/float-array.js +46 -49
- package/dist/codec/i16-array.d.ts +6 -6
- package/dist/codec/i16-array.js +22 -29
- package/dist/codec/i32-array.d.ts +6 -6
- package/dist/codec/i32-array.js +22 -29
- package/dist/codec/i64-array.d.ts +6 -6
- package/dist/codec/i64-array.js +22 -29
- package/dist/codec/i8-array.d.ts +4 -4
- package/dist/codec/i8-array.js +16 -16
- package/dist/codec/primitive.d.ts +36 -36
- package/dist/codec/primitive.js +139 -132
- package/dist/codec/string.d.ts +4 -2
- package/dist/codec/string.js +81 -77
- package/dist/codec/u16-array.d.ts +6 -6
- package/dist/codec/u16-array.js +22 -29
- package/dist/codec/u32-array.d.ts +6 -6
- package/dist/codec/u32-array.js +22 -29
- package/dist/codec/u64-array.d.ts +6 -6
- package/dist/codec/u64-array.js +22 -29
- package/dist/codec/u8-array.d.ts +4 -4
- package/dist/codec/u8-array.js +18 -16
- package/dist/codec/u8-clamped-array.d.ts +4 -4
- package/dist/codec/u8-clamped-array.js +16 -16
- package/dist/core/byte-cursor.d.ts +26 -8
- package/dist/core/byte-cursor.js +18 -28
- package/dist/index.cjs +551 -571
- package/package.json +1 -1
- package/CHANGELOG.md +0 -37
package/package.json
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## Unreleased
|
|
4
|
-
|
|
5
|
-
## 0.1.1 (2022-01-09)
|
|
6
|
-
|
|
7
|
-
* Fix write offset when byteOffset > 0
|
|
8
|
-
|
|
9
|
-
A ByteCursor may be instantiated with an array of bytes such that
|
|
10
|
-
the array's byteOffset is greater than 0.
|
|
11
|
-
The previous ByteCursor.write implementation did not take care of adding this byteOffset to the ByteCursor's offset.
|
|
12
|
-
|
|
13
|
-
The following code no longer fail:
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
const bytes = Uint8Array.of(42, 24).subarray(1)
|
|
17
|
-
assert(bytes.byteOffset === 1)
|
|
18
|
-
|
|
19
|
-
const bc = ByteCursor(bytes, ...)
|
|
20
|
-
bc.write(Uint8Array.of(24))
|
|
21
|
-
assert.deepEqual(Array.from(bytes), [42, 24]) // Previously failed
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
* Smaller CommonJS bundle
|
|
25
|
-
|
|
26
|
-
* Improve byte-length computation of small string
|
|
27
|
-
|
|
28
|
-
## 0.1.0 (2022-01-02)
|
|
29
|
-
|
|
30
|
-
* `ByteCursor` abstraction to read and write safely a buffer of bytes
|
|
31
|
-
|
|
32
|
-
* Enable to configure at runtime:
|
|
33
|
-
- initial buffer length
|
|
34
|
-
- maximum buffer length
|
|
35
|
-
- thresholds (string length) for switching from custom to native UTF-8 decoders/encoders
|
|
36
|
-
|
|
37
|
-
* Decoders and encoders for basic types (bool, opaque data, floats, integers, typed arrays, UTF-8 string)
|