+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
angular.
module('Arvados', []).
service('ArvadosClient', ArvadosClient);
return this;
////////////////////////////////
- var that = this;
var promiseDiscovery;
var discoveryDoc;
var meth = discoveryDoc.resources[controller].methods[action];
var data = $.extend({}, params, {_method: meth.httpMethod});
$.each(data, function(k, v) {
- if (typeof(v) == 'object') {
+ if (typeof(v) === 'object') {
data[k] = JSON.stringify(v);
}
});
var nameStub = origName;
var suffixInt = null;
var ok = false;
- var lineMatch, linesRe = /[^\n]+/g;
- var streamNameMatch, streamNameRe = /^\S+/;
+ var lineMatch, linesRe = /(\S+).*/gm;
var fileTokenMatch, fileTokensRe = / \d+:\d+:(\S+)/g;
while (!ok) {
ok = true;
replace(/ /g, '\\040');
while (ok && null !==
(lineMatch = linesRe.exec(manifest))) {
- streamNameMatch = streamNameRe.exec(lineMatch[0]);
+ // lineMatch is [theEntireLine, streamName]
while (ok && null !==
(fileTokenMatch = fileTokensRe.exec(lineMatch[0]))) {
- if (streamNameMatch[0] + '/' + fileTokenMatch[1]
+ // fileTokenMatch is [theEntireToken, fileName]
+ if (lineMatch[1] + '/' + fileTokenMatch[1]
===
newStreamName + '/' + newName) {
ok = false;