This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 3 files changed +16
-9
lines changed
3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 47
47
"form-data" : " ^1.0.0-rc4" ,
48
48
"gulp" : " ^3.9.1" ,
49
49
"idb-plus-blob-store" : " ^1.1.2" ,
50
- "interface-ipfs-core" : " ^0.7.2 " ,
50
+ "interface-ipfs-core" : " ^0.8.0 " ,
51
51
"left-pad" : " ^1.1.1" ,
52
52
"lodash" : " ^4.14.1" ,
53
53
"ncp" : " ^2.0.0" ,
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ const utils = require('../../utils')
4
4
const debug = require ( 'debug' )
5
5
const log = debug ( 'cli:version' )
6
6
log . error = debug ( 'cli:version:error' )
7
- const bs58 = require ( 'bs58' )
8
7
const fs = require ( 'fs' )
9
8
const path = require ( 'path' )
10
9
const glob = require ( 'glob' )
@@ -68,8 +67,10 @@ module.exports = {
68
67
const added = [ ]
69
68
70
69
i . on ( 'data' , ( file ) => {
71
- const hash = bs58 . encode ( file . node . multihash ( ) ) . toString ( )
72
- added . push ( { hash, path : file . path } )
70
+ added . push ( {
71
+ hash : file . hash ,
72
+ path : file . path
73
+ } )
73
74
} )
74
75
75
76
i . on ( 'end' , ( ) => {
Original file line number Diff line number Diff line change @@ -30,11 +30,16 @@ module.exports = function files (self) {
30
30
31
31
i . on ( 'data' , ( file ) => {
32
32
counter ++
33
+ const bs58mh = multihashes . toB58String ( file . multihash )
33
34
self . object . get ( file . multihash , ( err , node ) => {
34
35
if ( err ) {
35
36
return ds . emit ( 'error' , err )
36
37
}
37
- ds . push ( { path : file . path , node : node } )
38
+ ds . push ( {
39
+ path : file . path ,
40
+ hash : bs58mh ,
41
+ size : node . size ( )
42
+ } )
38
43
counter --
39
44
} )
40
45
} )
@@ -79,12 +84,13 @@ module.exports = function files (self) {
79
84
80
85
// Transform file info tuples to DAGNodes
81
86
i . pipe ( through . obj ( ( info , enc , next ) => {
82
- const mh = multihashes . toB58String ( info . multihash )
83
- self . _dagS . get ( mh , ( err , node ) => {
87
+ const bs58mh = multihashes . toB58String ( info . multihash )
88
+ self . _dagS . get ( bs58mh , ( err , node ) => {
84
89
if ( err ) return callback ( err )
85
90
var obj = {
86
- path : info . path || mh ,
87
- node : node
91
+ path : info . path || bs58mh ,
92
+ hash : bs58mh ,
93
+ size : node . size ( )
88
94
}
89
95
res . push ( obj )
90
96
next ( )
You can’t perform that action at this time.
0 commit comments