@ethersphere/bee-js 8.3.0 → 8.3.1

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.
@@ -13,6 +13,10 @@ async function writeTar(collection, tarStream) {
13
13
  await tarStream.endFile();
14
14
  stream.close();
15
15
  }
16
+ else if (item.file) {
17
+ await tarStream.appendFile(new Uint8Array(await item.file.arrayBuffer()));
18
+ await tarStream.endFile();
19
+ }
16
20
  else {
17
21
  throw new Error('Invalid collection item');
18
22
  }
@@ -44,7 +44,7 @@ function createHeader(path, size) {
44
44
  header.set(bytes.slice(0, length), offset);
45
45
  }
46
46
  // Initialize header with zeros
47
- const header = new Uint8Array();
47
+ const header = new Uint8Array(512);
48
48
  header.fill(0, 0, 512);
49
49
  // File name, truncated to 100 characters if necessary
50
50
  writeToBuffer(path.slice(0, 100).padEnd(100, '\0'), 0, 100);