@dxos/hypercore 0.1.45 → 0.1.46-next.c3cc04c
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/hypercore",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46-next.c3cc04c",
|
|
4
4
|
"description": "Hypercore wrapper and utils.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -20,24 +20,24 @@
|
|
|
20
20
|
"hypercore-protocol": "^8.0.7",
|
|
21
21
|
"readable-stream": "^3.6.0",
|
|
22
22
|
"streamx": "^2.12.5",
|
|
23
|
-
"@dxos/async": "0.1.
|
|
24
|
-
"@dxos/codec-protobuf": "0.1.
|
|
25
|
-
"@dxos/crypto": "0.1.
|
|
26
|
-
"@dxos/debug": "0.1.
|
|
27
|
-
"@dxos/
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/
|
|
23
|
+
"@dxos/async": "0.1.46-next.c3cc04c",
|
|
24
|
+
"@dxos/codec-protobuf": "0.1.46-next.c3cc04c",
|
|
25
|
+
"@dxos/crypto": "0.1.46-next.c3cc04c",
|
|
26
|
+
"@dxos/debug": "0.1.46-next.c3cc04c",
|
|
27
|
+
"@dxos/keys": "0.1.46-next.c3cc04c",
|
|
28
|
+
"@dxos/node-std": "0.1.46-next.c3cc04c",
|
|
29
|
+
"@dxos/random-access-storage": "0.1.46-next.c3cc04c"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
+
"@faker-js/faker": "^7.3.0",
|
|
32
33
|
"@types/debug": "^4.1.7",
|
|
33
34
|
"@types/faker": "^5.5.9",
|
|
34
35
|
"@types/randombytes": "^2.0.0",
|
|
35
36
|
"@types/readable-stream": "^2.3.9",
|
|
36
37
|
"debug": "^4.3.3",
|
|
37
|
-
"faker": "^5.5.3",
|
|
38
38
|
"random-access-memory": "^4.1.0",
|
|
39
|
-
"@dxos/log": "0.1.
|
|
40
|
-
"@dxos/util": "0.1.
|
|
39
|
+
"@dxos/log": "0.1.46-next.c3cc04c",
|
|
40
|
+
"@dxos/util": "0.1.46-next.c3cc04c"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2019 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { faker } from '@faker-js/faker';
|
|
5
6
|
import { expect } from 'chai';
|
|
6
|
-
import faker from 'faker';
|
|
7
7
|
|
|
8
8
|
import { createKeyPair } from '@dxos/crypto';
|
|
9
9
|
import { describe, test } from '@dxos/test';
|
|
@@ -31,7 +31,7 @@ describe('HypercoreFactory', () => {
|
|
|
31
31
|
{
|
|
32
32
|
const data = Array.from({ length: numBlocks }).map((_, i) => createDataItem(i));
|
|
33
33
|
for await (const datum of data) {
|
|
34
|
-
const feed = faker.
|
|
34
|
+
const feed = faker.helpers.arrayElement(feeds);
|
|
35
35
|
await py(feed, feed.append)(Buffer.from(JSON.stringify(datum)));
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -41,7 +41,7 @@ describe('HypercoreFactory', () => {
|
|
|
41
41
|
const total = feeds.reduce((result, feed) => result + feed.length, 0);
|
|
42
42
|
expect(total).to.eq(numBlocks);
|
|
43
43
|
|
|
44
|
-
const feed = faker.
|
|
44
|
+
const feed = faker.helpers.arrayElement(feeds);
|
|
45
45
|
const block1 = await py(feed, feed.head)();
|
|
46
46
|
const block2 = await py(feed, feed.get)(feed.length - 1);
|
|
47
47
|
expect(block1.toString()).to.eq(block2.toString());
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2020 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { faker } from '@faker-js/faker';
|
|
5
6
|
import { expect } from 'chai';
|
|
6
|
-
import faker from 'faker';
|
|
7
7
|
import ProtocolStream from 'hypercore-protocol';
|
|
8
8
|
|
|
9
9
|
import { latch } from '@dxos/async';
|
|
@@ -213,7 +213,7 @@ describe('ProtocolStream', () => {
|
|
|
213
213
|
});
|
|
214
214
|
|
|
215
215
|
Array.from(Array(numBlocks)).forEach((_, i) => {
|
|
216
|
-
const [core1] = faker.
|
|
216
|
+
const [core1] = faker.helpers.arrayElement(feeds);
|
|
217
217
|
core1.append(`block-${i}`, () => {});
|
|
218
218
|
});
|
|
219
219
|
|
package/src/multiplexer.test.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { faker } from '@faker-js/faker';
|
|
5
6
|
import { expect } from 'chai';
|
|
6
|
-
import faker from 'faker';
|
|
7
7
|
import { PassThrough, Transform } from 'streamx';
|
|
8
8
|
|
|
9
9
|
import { latch } from '@dxos/async';
|
|
@@ -56,7 +56,7 @@ describe('Multiplexing', () => {
|
|
|
56
56
|
const numMessages = 1;
|
|
57
57
|
const written = new Set<string>();
|
|
58
58
|
Array.from(Array(numMessages)).forEach((_, i) => {
|
|
59
|
-
const [core] = faker.
|
|
59
|
+
const [core] = faker.helpers.arrayElement(feeds);
|
|
60
60
|
written.add(core.key.toString());
|
|
61
61
|
core.append(`test-${i}: ${faker.lorem.sentence(10)}`, noop); // Long message.
|
|
62
62
|
});
|
package/src/replicate.test.ts
CHANGED