@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.
package/dist/mjs/feed/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import * as chunkAPI from "../modules/chunk.js";
|
|
|
4
4
|
import { fetchLatestFeedUpdate } from "../modules/feed.js";
|
|
5
5
|
import { FEED_INDEX_HEX_LENGTH } from "../types/index.js";
|
|
6
6
|
import { bytesAtOffset, makeBytes } from "../utils/bytes.js";
|
|
7
|
+
import { BeeResponseError } from "../utils/error.js";
|
|
7
8
|
import { makeHexEthAddress } from "../utils/eth.js";
|
|
8
9
|
import { keccak256Hash } from "../utils/hash.js";
|
|
9
10
|
import { bytesToHex, hexToBytes, makeHexString } from "../utils/hex.js";
|
|
@@ -18,7 +19,7 @@ export async function findNextIndex(requestOptions, owner, topic, options) {
|
|
|
18
19
|
const feedUpdate = await fetchLatestFeedUpdate(requestOptions, owner, topic, options);
|
|
19
20
|
return makeHexString(feedUpdate.feedIndexNext, FEED_INDEX_HEX_LENGTH);
|
|
20
21
|
} catch (e) {
|
|
21
|
-
if (e
|
|
22
|
+
if (e instanceof BeeResponseError) {
|
|
22
23
|
return bytesToHex(makeBytes(8));
|
|
23
24
|
}
|
|
24
25
|
throw e;
|
|
@@ -3,7 +3,7 @@ export function isCollection(data) {
|
|
|
3
3
|
if (!Array.isArray(data)) {
|
|
4
4
|
return false;
|
|
5
5
|
}
|
|
6
|
-
return data.every(entry => typeof entry === 'object' && entry.path && entry.size);
|
|
6
|
+
return data.every(entry => typeof entry === 'object' && entry.path && entry.size !== undefined);
|
|
7
7
|
}
|
|
8
8
|
export function assertCollection(data) {
|
|
9
9
|
if (!isCollection(data)) {
|