@ipld/car 4.1.0 → 4.1.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.
- package/cjs/browser-test/test-indexer.js +1 -1
- package/cjs/browser-test/test-reader.js +2 -2
- package/cjs/browser-test/test-writer.js +3 -3
- package/cjs/node-test/test-indexer.js +1 -1
- package/cjs/node-test/test-reader.js +2 -2
- package/cjs/node-test/test-writer.js +3 -3
- package/esm/browser-test/test-indexer.js +1 -1
- package/esm/browser-test/test-reader.js +2 -2
- package/esm/browser-test/test-writer.js +3 -3
- package/esm/node-test/test-indexer.js +1 -1
- package/esm/node-test/test-reader.js +2 -2
- package/esm/node-test/test-writer.js +3 -3
- package/package.json +2 -2
- package/test/test-indexer.js +1 -1
- package/test/test-reader.js +2 -2
- package/test/test-writer.js +3 -3
|
@@ -19,7 +19,7 @@ describe('CarIndexer fromBytes()', () => {
|
|
|
19
19
|
const indexer$1 = await indexer.CarIndexer.fromBytes(common.goCarV2Bytes);
|
|
20
20
|
const roots = await indexer$1.getRoots();
|
|
21
21
|
common.assert.strictEqual(roots.length, 1);
|
|
22
|
-
common.assert(common.goCarV2Roots[0].equals(roots[0]));
|
|
22
|
+
common.assert.ok(common.goCarV2Roots[0].equals(roots[0]));
|
|
23
23
|
common.assert.strictEqual(indexer$1.version, 2);
|
|
24
24
|
const indexData = [];
|
|
25
25
|
for await (const index of indexer$1) {
|
|
@@ -76,13 +76,13 @@ describe('CarReader fromBytes()', () => {
|
|
|
76
76
|
const reader = await readerBrowser.CarReader.fromBytes(common.goCarV2Bytes);
|
|
77
77
|
const roots = await reader.getRoots();
|
|
78
78
|
common.assert.strictEqual(roots.length, 1);
|
|
79
|
-
common.assert(common.goCarV2Roots[0].equals(roots[0]));
|
|
79
|
+
common.assert.ok(common.goCarV2Roots[0].equals(roots[0]));
|
|
80
80
|
common.assert.strictEqual(reader.version, 2);
|
|
81
81
|
for (const {cid} of common.goCarV2Index) {
|
|
82
82
|
const block = await reader.get(cid);
|
|
83
83
|
common.assert.isDefined(block);
|
|
84
84
|
if (block) {
|
|
85
|
-
common.assert(cid.equals(block.cid));
|
|
85
|
+
common.assert.ok(cid.equals(block.cid));
|
|
86
86
|
let content;
|
|
87
87
|
if (cid.code === dagPb__namespace.code) {
|
|
88
88
|
content = dagPb__namespace.decode(block.bytes);
|
|
@@ -182,9 +182,9 @@ describe('CarWriter', () => {
|
|
|
182
182
|
const rawBytes = await append(0);
|
|
183
183
|
const pbBytes = await append(1);
|
|
184
184
|
const cborBytes = await append(2);
|
|
185
|
-
common.assert(rawBytes.length > 0);
|
|
186
|
-
common.assert(pbBytes.length > 0);
|
|
187
|
-
common.assert(cborBytes.length > 0);
|
|
185
|
+
common.assert.ok(rawBytes.length > 0);
|
|
186
|
+
common.assert.ok(pbBytes.length > 0);
|
|
187
|
+
common.assert.ok(cborBytes.length > 0);
|
|
188
188
|
const reassembled = concatBytes([
|
|
189
189
|
headerBytes,
|
|
190
190
|
rawBytes,
|
|
@@ -19,7 +19,7 @@ describe('CarIndexer fromBytes()', () => {
|
|
|
19
19
|
const indexer$1 = await indexer.CarIndexer.fromBytes(common.goCarV2Bytes);
|
|
20
20
|
const roots = await indexer$1.getRoots();
|
|
21
21
|
common.assert.strictEqual(roots.length, 1);
|
|
22
|
-
common.assert(common.goCarV2Roots[0].equals(roots[0]));
|
|
22
|
+
common.assert.ok(common.goCarV2Roots[0].equals(roots[0]));
|
|
23
23
|
common.assert.strictEqual(indexer$1.version, 2);
|
|
24
24
|
const indexData = [];
|
|
25
25
|
for await (const index of indexer$1) {
|
|
@@ -76,13 +76,13 @@ describe('CarReader fromBytes()', () => {
|
|
|
76
76
|
const reader$1 = await reader.CarReader.fromBytes(common.goCarV2Bytes);
|
|
77
77
|
const roots = await reader$1.getRoots();
|
|
78
78
|
common.assert.strictEqual(roots.length, 1);
|
|
79
|
-
common.assert(common.goCarV2Roots[0].equals(roots[0]));
|
|
79
|
+
common.assert.ok(common.goCarV2Roots[0].equals(roots[0]));
|
|
80
80
|
common.assert.strictEqual(reader$1.version, 2);
|
|
81
81
|
for (const {cid} of common.goCarV2Index) {
|
|
82
82
|
const block = await reader$1.get(cid);
|
|
83
83
|
common.assert.isDefined(block);
|
|
84
84
|
if (block) {
|
|
85
|
-
common.assert(cid.equals(block.cid));
|
|
85
|
+
common.assert.ok(cid.equals(block.cid));
|
|
86
86
|
let content;
|
|
87
87
|
if (cid.code === dagPb__namespace.code) {
|
|
88
88
|
content = dagPb__namespace.decode(block.bytes);
|
|
@@ -182,9 +182,9 @@ describe('CarWriter', () => {
|
|
|
182
182
|
const rawBytes = await append(0);
|
|
183
183
|
const pbBytes = await append(1);
|
|
184
184
|
const cborBytes = await append(2);
|
|
185
|
-
common.assert(rawBytes.length > 0);
|
|
186
|
-
common.assert(pbBytes.length > 0);
|
|
187
|
-
common.assert(cborBytes.length > 0);
|
|
185
|
+
common.assert.ok(rawBytes.length > 0);
|
|
186
|
+
common.assert.ok(pbBytes.length > 0);
|
|
187
|
+
common.assert.ok(cborBytes.length > 0);
|
|
188
188
|
const reassembled = concatBytes([
|
|
189
189
|
headerBytes,
|
|
190
190
|
rawBytes,
|
|
@@ -24,7 +24,7 @@ describe('CarIndexer fromBytes()', () => {
|
|
|
24
24
|
const indexer = await CarIndexer.fromBytes(goCarV2Bytes);
|
|
25
25
|
const roots = await indexer.getRoots();
|
|
26
26
|
assert.strictEqual(roots.length, 1);
|
|
27
|
-
assert(goCarV2Roots[0].equals(roots[0]));
|
|
27
|
+
assert.ok(goCarV2Roots[0].equals(roots[0]));
|
|
28
28
|
assert.strictEqual(indexer.version, 2);
|
|
29
29
|
const indexData = [];
|
|
30
30
|
for await (const index of indexer) {
|
|
@@ -68,13 +68,13 @@ describe('CarReader fromBytes()', () => {
|
|
|
68
68
|
const reader = await CarReader.fromBytes(goCarV2Bytes);
|
|
69
69
|
const roots = await reader.getRoots();
|
|
70
70
|
assert.strictEqual(roots.length, 1);
|
|
71
|
-
assert(goCarV2Roots[0].equals(roots[0]));
|
|
71
|
+
assert.ok(goCarV2Roots[0].equals(roots[0]));
|
|
72
72
|
assert.strictEqual(reader.version, 2);
|
|
73
73
|
for (const {cid} of goCarV2Index) {
|
|
74
74
|
const block = await reader.get(cid);
|
|
75
75
|
assert.isDefined(block);
|
|
76
76
|
if (block) {
|
|
77
|
-
assert(cid.equals(block.cid));
|
|
77
|
+
assert.ok(cid.equals(block.cid));
|
|
78
78
|
let content;
|
|
79
79
|
if (cid.code === dagPb.code) {
|
|
80
80
|
content = dagPb.decode(block.bytes);
|
|
@@ -193,9 +193,9 @@ describe('CarWriter', () => {
|
|
|
193
193
|
const rawBytes = await append(0);
|
|
194
194
|
const pbBytes = await append(1);
|
|
195
195
|
const cborBytes = await append(2);
|
|
196
|
-
assert(rawBytes.length > 0);
|
|
197
|
-
assert(pbBytes.length > 0);
|
|
198
|
-
assert(cborBytes.length > 0);
|
|
196
|
+
assert.ok(rawBytes.length > 0);
|
|
197
|
+
assert.ok(pbBytes.length > 0);
|
|
198
|
+
assert.ok(cborBytes.length > 0);
|
|
199
199
|
const reassembled = concatBytes([
|
|
200
200
|
headerBytes,
|
|
201
201
|
rawBytes,
|
|
@@ -24,7 +24,7 @@ describe('CarIndexer fromBytes()', () => {
|
|
|
24
24
|
const indexer = await CarIndexer.fromBytes(goCarV2Bytes);
|
|
25
25
|
const roots = await indexer.getRoots();
|
|
26
26
|
assert.strictEqual(roots.length, 1);
|
|
27
|
-
assert(goCarV2Roots[0].equals(roots[0]));
|
|
27
|
+
assert.ok(goCarV2Roots[0].equals(roots[0]));
|
|
28
28
|
assert.strictEqual(indexer.version, 2);
|
|
29
29
|
const indexData = [];
|
|
30
30
|
for await (const index of indexer) {
|
|
@@ -68,13 +68,13 @@ describe('CarReader fromBytes()', () => {
|
|
|
68
68
|
const reader = await CarReader.fromBytes(goCarV2Bytes);
|
|
69
69
|
const roots = await reader.getRoots();
|
|
70
70
|
assert.strictEqual(roots.length, 1);
|
|
71
|
-
assert(goCarV2Roots[0].equals(roots[0]));
|
|
71
|
+
assert.ok(goCarV2Roots[0].equals(roots[0]));
|
|
72
72
|
assert.strictEqual(reader.version, 2);
|
|
73
73
|
for (const {cid} of goCarV2Index) {
|
|
74
74
|
const block = await reader.get(cid);
|
|
75
75
|
assert.isDefined(block);
|
|
76
76
|
if (block) {
|
|
77
|
-
assert(cid.equals(block.cid));
|
|
77
|
+
assert.ok(cid.equals(block.cid));
|
|
78
78
|
let content;
|
|
79
79
|
if (cid.code === dagPb.code) {
|
|
80
80
|
content = dagPb.decode(block.bytes);
|
|
@@ -193,9 +193,9 @@ describe('CarWriter', () => {
|
|
|
193
193
|
const rawBytes = await append(0);
|
|
194
194
|
const pbBytes = await append(1);
|
|
195
195
|
const cborBytes = await append(2);
|
|
196
|
-
assert(rawBytes.length > 0);
|
|
197
|
-
assert(pbBytes.length > 0);
|
|
198
|
-
assert(cborBytes.length > 0);
|
|
196
|
+
assert.ok(rawBytes.length > 0);
|
|
197
|
+
assert.ok(pbBytes.length > 0);
|
|
198
|
+
assert.ok(cborBytes.length > 0);
|
|
199
199
|
const reassembled = concatBytes([
|
|
200
200
|
headerBytes,
|
|
201
201
|
rawBytes,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ipld/car",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Content Addressable aRchive format reader and writer",
|
|
5
5
|
"main": "./cjs/car.js",
|
|
6
6
|
"types": "./types/car.d.ts",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"jsdoc4readme": "^1.4.0",
|
|
94
94
|
"mocha": "^9.1.3",
|
|
95
95
|
"polendina": "~2.0.1",
|
|
96
|
-
"standard": "^
|
|
96
|
+
"standard": "^17.0.0",
|
|
97
97
|
"typescript": "~4.6.2"
|
|
98
98
|
},
|
|
99
99
|
"standard": {
|
package/test/test-indexer.js
CHANGED
|
@@ -30,7 +30,7 @@ describe('CarIndexer fromBytes()', () => {
|
|
|
30
30
|
const indexer = await CarIndexer.fromBytes(goCarV2Bytes)
|
|
31
31
|
const roots = await indexer.getRoots()
|
|
32
32
|
assert.strictEqual(roots.length, 1)
|
|
33
|
-
assert(goCarV2Roots[0].equals(roots[0]))
|
|
33
|
+
assert.ok(goCarV2Roots[0].equals(roots[0]))
|
|
34
34
|
assert.strictEqual(indexer.version, 2)
|
|
35
35
|
|
|
36
36
|
const indexData = []
|
package/test/test-reader.js
CHANGED
|
@@ -65,13 +65,13 @@ describe('CarReader fromBytes()', () => {
|
|
|
65
65
|
const reader = await CarReader.fromBytes(goCarV2Bytes)
|
|
66
66
|
const roots = await reader.getRoots()
|
|
67
67
|
assert.strictEqual(roots.length, 1)
|
|
68
|
-
assert(goCarV2Roots[0].equals(roots[0]))
|
|
68
|
+
assert.ok(goCarV2Roots[0].equals(roots[0]))
|
|
69
69
|
assert.strictEqual(reader.version, 2)
|
|
70
70
|
for (const { cid } of goCarV2Index) {
|
|
71
71
|
const block = await reader.get(cid)
|
|
72
72
|
assert.isDefined(block)
|
|
73
73
|
if (block) {
|
|
74
|
-
assert(cid.equals(block.cid))
|
|
74
|
+
assert.ok(cid.equals(block.cid))
|
|
75
75
|
let content
|
|
76
76
|
if (cid.code === dagPb.code) {
|
|
77
77
|
content = dagPb.decode(block.bytes)
|
package/test/test-writer.js
CHANGED
|
@@ -265,9 +265,9 @@ describe('CarWriter', () => {
|
|
|
265
265
|
const pbBytes = await append(1)
|
|
266
266
|
const cborBytes = await append(2)
|
|
267
267
|
|
|
268
|
-
assert(rawBytes.length > 0)
|
|
269
|
-
assert(pbBytes.length > 0)
|
|
270
|
-
assert(cborBytes.length > 0)
|
|
268
|
+
assert.ok(rawBytes.length > 0)
|
|
269
|
+
assert.ok(pbBytes.length > 0)
|
|
270
|
+
assert.ok(cborBytes.length > 0)
|
|
271
271
|
|
|
272
272
|
const reassembled = concatBytes([headerBytes, rawBytes, pbBytes, cborBytes])
|
|
273
273
|
|