utilium 2.2.1 → 2.2.2
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/buffer.js +6 -3
- package/package.json +1 -1
package/dist/buffer.js
CHANGED
@@ -46,11 +46,14 @@ export function initView(view, buffer, byteOffset, byteLength) {
|
|
46
46
|
}
|
47
47
|
if (!buffer
|
48
48
|
|| buffer instanceof ArrayBuffer
|
49
|
-
|| (globalThis.SharedArrayBuffer && buffer instanceof
|
50
|
-
const
|
49
|
+
|| (globalThis.SharedArrayBuffer && buffer instanceof SharedArrayBuffer)) {
|
50
|
+
const size = byteLength
|
51
|
+
?? view.constructor?.[Symbol.metadata]?.struct?.size // Memium structs
|
52
|
+
?? buffer?.byteLength
|
53
|
+
?? 0;
|
51
54
|
view.buffer = buffer ?? new ArrayBuffer(size);
|
52
55
|
view.byteOffset = byteOffset ?? 0;
|
53
|
-
view.byteLength =
|
56
|
+
view.byteLength = size;
|
54
57
|
return;
|
55
58
|
}
|
56
59
|
if (ArrayBuffer.isView(buffer)) {
|