Skip to content

Commit

Permalink
fix: use normal string concatenation for cross-browser support
Browse files Browse the repository at this point in the history
  • Loading branch information
dpopp07 committed Sep 10, 2018
1 parent 6b8f2ba commit 3e0010f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions speech-to-text/get-models.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ module.exports = function getModels(options) {
};
var url = options.url || 'https://stream.watsonplatform.net/speech-to-text/api';
if (options.access_token) {
url = `${url}/v1/models?access_token=${options.access_token}`;
url = url + '/v1/models?access_token=' + options.access_token;
} else {
url = `${url}/v1/models?access_token=${options.token}`;
url = url + '/v1/models?access_token=' + options.token;
}
return fetch(url, reqOpts)
.then(function(response) {
Expand Down
4 changes: 2 additions & 2 deletions text-to-speech/get-voices.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ module.exports = function getVoices(options) {
};
var url = options.url || 'https://stream.watsonplatform.net/text-to-speech/api';
if (options.access_token) {
url = `${url}'/v1/voices?watson-token='${options.access_token}`;
url = url + '/v1/voices?watson-token=' + options.access_token;
} else {
url = `${url}'/v1/voices?watson-token='${options.token}`;
url = url + '/v1/voices?watson-token=' + options.token;
}
return fetch(url, reqOpts)
.then(function(response) {
Expand Down
2 changes: 1 addition & 1 deletion text-to-speech/synthesize.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = function synthesize(options) {
var url = options.url || 'https://stream.watsonplatform.net/text-to-speech/api';
var audio = options.element || new Audio();
audio.crossOrigin = 'anonymous';
audio.src = `${url}/v1/synthesize?${qs.stringify(pick(options, QUERY_PARAMS_ALLOWED))}`;
audio.src = url + '/v1/synthesize?' + qs.stringify(pick(options, QUERY_PARAMS_ALLOWED));
if (options.autoPlay !== false) {
audio.play();
}
Expand Down

0 comments on commit 3e0010f

Please sign in to comment.