@@ -15,6 +15,8 @@ const defaultOptions = {
15
15
endpoint : '/ms/api/availity/internal/core/vault/upload/v1/resumable' ,
16
16
chunkSize : 3e6 , // 3MB
17
17
removeFingerprintOnSuccess : true ,
18
+ retryDelays : [ 0 , 1000 , 3000 , 5000 ] ,
19
+ stripFileNamePathSegments : true ,
18
20
fingerprint ( file , options = { } ) {
19
21
const attributes = [ file . name , file . type , file . size , file . lastModified ] ;
20
22
let attributesKey = 'tus-' ;
@@ -58,7 +60,7 @@ class Upload {
58
60
}
59
61
60
62
this . file = file ;
61
- this . options = Object . assign ( options , defaultOptions ) ;
63
+ this . options = Object . assign ( { } , defaultOptions , options ) ;
62
64
this . percentage = 0 ;
63
65
this . onError = [ ] ;
64
66
this . onSuccess = [ ] ;
@@ -182,6 +184,7 @@ class Upload {
182
184
resume : true ,
183
185
endpoint : `${ this . options . endpoint } /${ this . options . bucketId } /` ,
184
186
chunkSize : this . options . chunkSize ,
187
+ retryDelays : this . options . retryDelays ,
185
188
removeFingerprintOnSuccess : this . options . removeFingerprintOnSuccess ,
186
189
fingerprint : this . options . fingerprint ,
187
190
metadata,
@@ -292,7 +295,7 @@ class Upload {
292
295
}
293
296
294
297
trimFileName ( fileName ) {
295
- if ( this . options . stripFileNamePathSegments !== false ) {
298
+ if ( this . options . stripFileNamePathSegments ) {
296
299
fileName = fileName . substring ( fileName . lastIndexOf ( '\\' ) + 1 ) ;
297
300
fileName = fileName . substring ( fileName . lastIndexOf ( '/' ) + 1 ) ;
298
301
}
0 commit comments