This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/core/components/files-regular Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,12 @@ module.exports = function (self) {
2828
2929 pull (
3030 exporter ( cid , self . _ipld , options ) ,
31+ pull . filter ( link => {
32+ return link . path === ipfsPath . substring ( 0 , link . path . length )
33+ } ) ,
3134 pull . filter ( link => {
3235 // save the closest matched path so we can show in error if no file was found
33- if ( ( link . path === ipfsPath . substring ( 0 , link . path . length ) &&
34- link . depth > closestMatchedLink . depth ) || ! closestMatchedLink ) {
36+ if ( ! closestMatchedLink || link . depth > closestMatchedLink . depth ) {
3537 closestMatchedLink = link
3638 }
3739
@@ -44,8 +46,8 @@ module.exports = function (self) {
4446 }
4547
4648 if ( ! files . length ) {
47- const fileNotFound = ipfsPath . substring ( closestMatchedLink . path . length + 1 )
48- return d . abort ( new Error ( `no file named "${ fileNotFound } " under ${ closestMatchedLink . path } ` ) )
49+ const linkNotFound = ipfsPath . substring ( closestMatchedLink . path . length + 1 )
50+ return d . abort ( new Error ( `no file named "${ linkNotFound } " under ${ closestMatchedLink . path } ` ) )
4951 }
5052
5153 const file = files [ 0 ]
You can’t perform that action at this time.
0 commit comments