@@ -180,7 +180,7 @@ describe('exporter', () => {
180
180
const file = await exporter ( result . cid , ipld )
181
181
182
182
expect ( file ) . to . have . property ( 'cid' )
183
- expect ( file ) . to . have . property ( 'path' , result . cid . toBaseEncodedString ( ) )
183
+ expect ( file ) . to . have . property ( 'path' , result . cid . toString ( ) )
184
184
185
185
if ( file . type !== 'file' ) {
186
186
throw new Error ( 'Unexpected type' )
@@ -199,11 +199,11 @@ describe('exporter', () => {
199
199
content : asAsyncIterable ( smallFile )
200
200
} ] , block ) )
201
201
202
- const path = `/ipfs/${ files [ 1 ] . cid . toBaseEncodedString ( ) } /${ fileName } `
202
+ const path = `/ipfs/${ files [ 1 ] . cid } /${ fileName } `
203
203
const file = await exporter ( path , ipld )
204
204
205
205
expect ( file . name ) . to . equal ( fileName )
206
- expect ( file . path ) . to . equal ( `${ files [ 1 ] . cid . toBaseEncodedString ( ) } /${ fileName } ` )
206
+ expect ( file . path ) . to . equal ( `${ files [ 1 ] . cid } /${ fileName } ` )
207
207
} )
208
208
209
209
it ( 'small file in a directory with an square brackets in the title' , async ( ) => {
@@ -215,11 +215,11 @@ describe('exporter', () => {
215
215
content : asAsyncIterable ( smallFile )
216
216
} ] , block ) )
217
217
218
- const path = `/ipfs/${ files [ 1 ] . cid . toBaseEncodedString ( ) } /${ fileName } `
218
+ const path = `/ipfs/${ files [ 1 ] . cid } /${ fileName } `
219
219
const file = await exporter ( path , ipld )
220
220
221
221
expect ( file . name ) . to . equal ( fileName )
222
- expect ( file . path ) . to . equal ( `${ files [ 1 ] . cid . toBaseEncodedString ( ) } /${ fileName } ` )
222
+ expect ( file . path ) . to . equal ( `${ files [ 1 ] . cid } /${ fileName } ` )
223
223
} )
224
224
225
225
it ( 'exports a chunk of a file with no links' , async ( ) => {
@@ -338,7 +338,7 @@ describe('exporter', () => {
338
338
throw new Error ( 'Unexpected type' )
339
339
}
340
340
341
- expect ( file ) . to . have . property ( 'path' , cid . toBaseEncodedString ( ) )
341
+ expect ( file ) . to . have . property ( 'path' , cid . toString ( ) )
342
342
expect ( file . unixfs . fileSize ( ) ) . to . equal ( ONE_MEG * 6 )
343
343
} )
344
344
@@ -354,7 +354,7 @@ describe('exporter', () => {
354
354
} )
355
355
356
356
const file = await exporter ( cid , ipld )
357
- expect ( file ) . to . have . property ( 'path' , cid . toBaseEncodedString ( ) )
357
+ expect ( file ) . to . have . property ( 'path' , cid . toString ( ) )
358
358
359
359
if ( file . type !== 'file' ) {
360
360
throw new Error ( 'Unexpected type' )
@@ -432,9 +432,9 @@ describe('exporter', () => {
432
432
expect (
433
433
files . map ( ( file ) => file . path )
434
434
) . to . be . eql ( [
435
- `${ dir . cid . toBaseEncodedString ( ) } /200Bytes.txt` ,
436
- `${ dir . cid . toBaseEncodedString ( ) } /dir-another` ,
437
- `${ dir . cid . toBaseEncodedString ( ) } /level-1`
435
+ `${ dir . cid } /200Bytes.txt` ,
436
+ `${ dir . cid } /dir-another` ,
437
+ `${ dir . cid } /level-1`
438
438
] )
439
439
440
440
files
@@ -480,9 +480,9 @@ describe('exporter', () => {
480
480
expect (
481
481
files . map ( ( file ) => file . path )
482
482
) . to . be . eql ( [
483
- `${ importedDir . cid . toBaseEncodedString ( ) } /200Bytes.txt` ,
484
- `${ importedDir . cid . toBaseEncodedString ( ) } /dir-another` ,
485
- `${ importedDir . cid . toBaseEncodedString ( ) } /level-1`
483
+ `${ importedDir . cid } /200Bytes.txt` ,
484
+ `${ importedDir . cid } /dir-another` ,
485
+ `${ importedDir . cid } /level-1`
486
486
] )
487
487
488
488
expect (
@@ -942,7 +942,7 @@ describe('exporter', () => {
942
942
} , mc . DAG_CBOR )
943
943
944
944
try {
945
- await exporter ( `${ cborNodeCid . toBaseEncodedString ( ) } /baz` , ipld )
945
+ await exporter ( `${ cborNodeCid } /baz` , ipld )
946
946
} catch ( err ) {
947
947
expect ( err . code ) . to . equal ( 'ERR_NO_PROP' )
948
948
}
@@ -954,7 +954,7 @@ describe('exporter', () => {
954
954
}
955
955
956
956
const cborNodeCid = await ipld . put ( node , mc . DAG_CBOR )
957
- const exported = await exporter ( `${ cborNodeCid . toBaseEncodedString ( ) } ` , ipld )
957
+ const exported = await exporter ( `${ cborNodeCid } ` , ipld )
958
958
959
959
if ( exported . type !== 'object' ) {
960
960
throw new Error ( 'Unexpected type' )
@@ -967,7 +967,7 @@ describe('exporter', () => {
967
967
const cid = new CID ( 1 , 'git-raw' , new CID ( 'zdj7WkRPAX9o9nb9zPbXzwG7JEs78uyhwbUs8JSUayB98DWWY' ) . multihash )
968
968
969
969
try {
970
- await exporter ( `${ cid . toBaseEncodedString ( ) } ` , ipld )
970
+ await exporter ( `${ cid } ` , ipld )
971
971
} catch ( err ) {
972
972
expect ( err . code ) . to . equal ( 'ERR_NO_RESOLVER' )
973
973
}
@@ -977,7 +977,7 @@ describe('exporter', () => {
977
977
const cid = await ipld . put ( Uint8Array . from ( [ 0 , 1 , 2 , 3 , 4 ] ) , mc . RAW )
978
978
979
979
try {
980
- await exporter ( `${ cid . toBaseEncodedString ( ) } /lol` , ipld )
980
+ await exporter ( `${ cid } /lol` , ipld )
981
981
} catch ( err ) {
982
982
expect ( err . code ) . to . equal ( 'ERR_NOT_FOUND' )
983
983
}
@@ -1048,7 +1048,7 @@ describe('exporter', () => {
1048
1048
}
1049
1049
1050
1050
const exported = await all ( recursive ( dir . cid , ipld ) )
1051
- const dirCid = dir . cid . toBaseEncodedString ( )
1051
+ const dirCid = dir . cid . toString ( )
1052
1052
1053
1053
expect ( exported [ 0 ] . depth ) . to . equal ( 0 )
1054
1054
expect ( exported [ 0 ] . name ) . to . equal ( dirCid )
0 commit comments