@dcmjs-org/parser 1.0.0-beta.10 → 1.0.0-beta.11
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/index.cjs +7 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +7 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1821,14 +1821,9 @@ async function fromPart10StreamImpl(input, listener, options, parseState) {
|
|
|
1821
1821
|
chunkSize: INFLATE_CHUNK_SIZE
|
|
1822
1822
|
});
|
|
1823
1823
|
inflater.onData = chunk => {
|
|
1824
|
-
// chunk is a Uint8Array (pako 2.x)
|
|
1825
|
-
//
|
|
1826
|
-
bodyStream.addBuffer(
|
|
1827
|
-
chunk.buffer.slice(
|
|
1828
|
-
chunk.byteOffset,
|
|
1829
|
-
chunk.byteOffset + chunk.byteLength
|
|
1830
|
-
)
|
|
1831
|
-
);
|
|
1824
|
+
// chunk is a Uint8Array (pako 2.x); addBuffer copies a view,
|
|
1825
|
+
// so bodyStream doesn't alias pako's buffer.
|
|
1826
|
+
bodyStream.addBuffer(chunk);
|
|
1832
1827
|
};
|
|
1833
1828
|
|
|
1834
1829
|
let relayPos = relayStartPos;
|
|
@@ -3118,16 +3113,12 @@ async function* readableStreamToAsyncIterable(stream) {
|
|
|
3118
3113
|
* arrays, and plain ArrayBuffers.
|
|
3119
3114
|
*
|
|
3120
3115
|
* @param {Uint8Array|ArrayBuffer} chunk
|
|
3121
|
-
* @returns {ArrayBuffer}
|
|
3116
|
+
* @returns {Uint8Array|ArrayBuffer} the chunk, after the type check
|
|
3122
3117
|
*/
|
|
3123
3118
|
function toArrayBuffer(chunk) {
|
|
3124
|
-
|
|
3125
|
-
if (ArrayBuffer.isView(chunk)) {
|
|
3126
|
-
|
|
3127
|
-
return chunk.buffer.slice(
|
|
3128
|
-
chunk.byteOffset,
|
|
3129
|
-
chunk.byteOffset + chunk.byteLength
|
|
3130
|
-
);
|
|
3119
|
+
// addBuffer copies a view (Uint8Array, Buffer, etc.) itself
|
|
3120
|
+
if (chunk instanceof ArrayBuffer || ArrayBuffer.isView(chunk)) {
|
|
3121
|
+
return chunk;
|
|
3131
3122
|
}
|
|
3132
3123
|
throw new TypeError(
|
|
3133
3124
|
`fromPart10Stream: expected Uint8Array|ArrayBuffer chunk from iterable, ` +
|