@ethersphere/bee-js 8.0.0 → 8.0.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.
@@ -30,6 +30,7 @@ const chunkAPI = __importStar(require("../modules/chunk"));
30
30
  const feed_1 = require("../modules/feed");
31
31
  const types_1 = require("../types");
32
32
  const bytes_1 = require("../utils/bytes");
33
+ const error_1 = require("../utils/error");
33
34
  const eth_1 = require("../utils/eth");
34
35
  const hash_1 = require("../utils/hash");
35
36
  const hex_1 = require("../utils/hex");
@@ -45,7 +46,7 @@ async function findNextIndex(requestOptions, owner, topic, options) {
45
46
  return (0, hex_1.makeHexString)(feedUpdate.feedIndexNext, types_1.FEED_INDEX_HEX_LENGTH);
46
47
  }
47
48
  catch (e) {
48
- if (e?.response?.status === 404) {
49
+ if (e instanceof error_1.BeeResponseError) {
49
50
  return (0, hex_1.bytesToHex)((0, bytes_1.makeBytes)(8));
50
51
  }
51
52
  throw e;
@@ -6,7 +6,7 @@ function isCollection(data) {
6
6
  if (!Array.isArray(data)) {
7
7
  return false;
8
8
  }
9
- return data.every(entry => typeof entry === 'object' && entry.path && entry.size);
9
+ return data.every(entry => typeof entry === 'object' && entry.path && entry.size !== undefined);
10
10
  }
11
11
  exports.isCollection = isCollection;
12
12
  function assertCollection(data) {