react-native-update 10.42.1 → 10.42.3

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.
@@ -51,6 +51,17 @@ export function parseManifestToArrays(
51
51
  };
52
52
  }
53
53
 
54
+ function toArrayBufferSlice(
55
+ payload: Uint8Array,
56
+ offset: number,
57
+ length: number,
58
+ ): ArrayBuffer {
59
+ return payload.buffer.slice(
60
+ payload.byteOffset + offset,
61
+ payload.byteOffset + offset + length,
62
+ );
63
+ }
64
+
54
65
  const DIFF_MANIFEST_ENTRY = '__diff.json';
55
66
  const HARMONY_BUNDLE_PATCH_ENTRY = 'bundle.harmony.js.patch';
56
67
  const TEMP_ORIGIN_BUNDLE_ENTRY = '.origin.bundle.harmony.js';
@@ -172,9 +183,13 @@ export class DownloadTask {
172
183
  let bytesWritten = 0;
173
184
 
174
185
  while (bytesWritten < payload.byteLength) {
175
- const chunk = payload.subarray(bytesWritten, bytesWritten + chunkSize);
186
+ const chunkLength = Math.min(
187
+ chunkSize,
188
+ payload.byteLength - bytesWritten,
189
+ );
190
+ const chunk = toArrayBufferSlice(payload, bytesWritten, chunkLength);
176
191
  await fileIo.write(writer.fd, chunk);
177
- bytesWritten += chunk.byteLength;
192
+ bytesWritten += chunkLength;
178
193
  }
179
194
  } finally {
180
195
  if (writer) {
@@ -268,7 +283,7 @@ export class DownloadTask {
268
283
  break;
269
284
  }
270
285
 
271
- await fileIo.write(writer.fd, new Uint8Array(buffer, 0, readLength));
286
+ await fileIo.write(writer.fd, buffer.slice(0, readLength));
272
287
  offset += readLength;
273
288
 
274
289
  if (readLength < FILE_COPY_BUFFER_SIZE) {
package/harmony/pushy.har CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.42.1",
3
+ "version": "10.42.3",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {
Binary file
Binary file