This repository was archived by the owner on Apr 29, 2020. It is now read-only.
File tree 2 files changed +29
-1
lines changed
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,6 @@ const toPathComponents = (path = '') => {
113
113
// split on / unless escaped with \
114
114
return ( path
115
115
. trim ( )
116
- . match ( / ( [ ^ \\ \] [ ^ / ] | \\ \/ ) + / g) || [ ] )
116
+ . match ( / ( [ ^ \\ ^ / ] | \\ \/ ) + / g) || [ ] )
117
117
. filter ( Boolean )
118
118
}
Original file line number Diff line number Diff line change @@ -257,6 +257,34 @@ describe('exporter', () => {
257
257
)
258
258
} )
259
259
260
+ it ( 'small file in a directory with an square brackets in the title' , ( done ) => {
261
+ const fileName = `small-[bar]-file-${ Math . random ( ) } .txt`
262
+ const filePath = `/foo/${ fileName } `
263
+
264
+ pull (
265
+ pull . values ( [ {
266
+ path : filePath ,
267
+ content : pull . values ( [ smallFile ] )
268
+ } ] ) ,
269
+ importer ( ipld ) ,
270
+ pull . collect ( ( err , files ) => {
271
+ expect ( err ) . to . not . exist ( )
272
+
273
+ const path = `/ipfs/${ new CID ( files [ 1 ] . multihash ) . toBaseEncodedString ( ) } /${ fileName } `
274
+
275
+ pull (
276
+ exporter ( path , ipld ) ,
277
+ pull . collect ( ( err , files ) => {
278
+ expect ( err ) . to . not . exist ( )
279
+ expect ( files . length ) . to . equal ( 1 )
280
+ expect ( files [ 0 ] . path ) . to . equal ( fileName )
281
+ done ( )
282
+ } )
283
+ )
284
+ } )
285
+ )
286
+ } )
287
+
260
288
it ( 'exports a chunk of a file with no links' , ( done ) => {
261
289
const offset = 0
262
290
const length = 5
You can’t perform that action at this time.
0 commit comments