bl 7.0.13 → 7.0.15
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/BufferList.js +1 -1
- package/CHANGELOG.md +12 -0
- package/package.json +2 -2
- package/test/test.js +28 -0
package/BufferList.js
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [7.0.15](https://github.com/rvagg/bl/compare/v7.0.14...v7.0.15) (2026-11-13)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* handle get on empty lists ([#190](https://github.com/rvagg/bl/issues/190)) ([39b2047](https://github.com/rvagg/bl/commit/39b204765312de24043106baf484a116a018c3df))
|
|
6
|
+
|
|
7
|
+
## [7.0.14](https://github.com/rvagg/bl/compare/v7.0.13...v7.0.14) (2026-10-30)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* do not restrict to `import` in exports map ([#189](https://github.com/rvagg/bl/issues/189)) ([ad43adb](https://github.com/rvagg/bl/commit/ad43adbea2b4320f690ddd4cfa90e5d7db01116a))
|
|
12
|
+
|
|
1
13
|
## [7.0.13](https://github.com/rvagg/bl/compare/v7.0.12...v7.0.13) (2026-10-19)
|
|
2
14
|
|
|
3
15
|
### Trivial Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bl",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.15",
|
|
4
4
|
"description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./types/index.d.ts",
|
|
15
|
-
"
|
|
15
|
+
"default": "./BufferListStream.js"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
package/test/test.js
CHANGED
|
@@ -1030,3 +1030,31 @@ tape('destroy with error', function (t) {
|
|
|
1030
1030
|
t.notOk(data, 'no data')
|
|
1031
1031
|
}))
|
|
1032
1032
|
})
|
|
1033
|
+
|
|
1034
|
+
tape('get handles empty lists', async function (t) {
|
|
1035
|
+
const { BufferList } = await import('../BufferListStream.js')
|
|
1036
|
+
|
|
1037
|
+
for (const Type of [BufferList, BufferListStream]) {
|
|
1038
|
+
const name = Type.name
|
|
1039
|
+
const list = new Type()
|
|
1040
|
+
const emptyGet = () => {
|
|
1041
|
+
try {
|
|
1042
|
+
return { value: list.get(0) }
|
|
1043
|
+
} catch (error) {
|
|
1044
|
+
return { error }
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
t.deepEqual(emptyGet(), { value: undefined }, `${name}: new empty list`)
|
|
1049
|
+
list.append(Buffer.from('a'))
|
|
1050
|
+
t.equal(list.get(0), 97, `${name}: first byte after append`)
|
|
1051
|
+
t.equal(list.get(1), undefined, `${name}: nonempty end index`)
|
|
1052
|
+
t.equal(list.get(-1), undefined, `${name}: negative index`)
|
|
1053
|
+
list.consume(1)
|
|
1054
|
+
t.deepEqual(emptyGet(), { value: undefined }, `${name}: fully consumed list`)
|
|
1055
|
+
list.append(Buffer.from('b'))
|
|
1056
|
+
t.equal(list.get(0), 98, `${name}: reuse after consumption`)
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
t.end()
|
|
1060
|
+
})
|