Commit 4746c3d
committed
More specific data types - ArrayBuffer instead of ArrayBufferLike
By default, TypeScript interfaces like `DataView` and `Uint8Array` are used with the more generic `ArrayBufferLike` type, representing that they can work with either `ArrayBuffer` or `SharedArrayBuffer`. TypeScript 5.9 now uses stricter types for interfaces such as the DOM `fetch` method: a DOM `BufferSource` is now (correctly) marked as requiring `ArrayBuffer`, not `SharedArrayBuffer`. As a result of that change, trying to use a @msgpack/msgpack `encode` result with a `fetch` call will result in a type error. This change updates the types in the `Encoder` class to use `ArrayBuffer` instead of `ArrayBufferLike`, which reflects their implementation and prevents issues with the newer, stricter interfaces.1 parent 0e02917 commit 4746c3d
2 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
| 87 | + | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
0 commit comments