Skip to content

Commit 3ce5de0

Browse files
committed
fix API V2 module 'josm/api'
1 parent 7ca6d8e commit 3ce5de0

File tree

1 file changed

+6
-4
lines changed
  • src/main/javascript/v2/josm

1 file changed

+6
-4
lines changed

src/main/javascript/v2/josm/api.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -985,10 +985,12 @@ exports.Api.upload = function (data, comment, options) {
985985
}
986986

987987
function uploadSpecFromOptions (options) {
988-
let strategy = options.strategy ||
989-
UploadStrategy.DEFAULT_UPLOAD_STRATEGY
990-
strategy = UploadStrategy.from(strategy)
991-
988+
let strategy = options.strategy || UploadStrategy.DEFAULT_UPLOAD_STRATEGY
989+
if (strategy instanceof String) {
990+
strategy = UploadStrategy.valueOf(strategy)
991+
util.assert(strategy, "invalid upload strategy ''{0}''", strategy)
992+
}
993+
992994
let chunkSize = options.chunkSize ||
993995
UploadStrategySpecification.UNSPECIFIED_CHUNK_SIZE
994996
chunkSize = normalizeChunkSize(chunkSize)

0 commit comments

Comments
 (0)