From 3e0010f3ef95c4d295d71090ec557972cadff6d6 Mon Sep 17 00:00:00 2001 From: Dustin Popp Date: Mon, 10 Sep 2018 16:52:14 -0500 Subject: [PATCH] fix: use normal string concatenation for cross-browser support --- speech-to-text/get-models.js | 4 ++-- text-to-speech/get-voices.js | 4 ++-- text-to-speech/synthesize.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/speech-to-text/get-models.js b/speech-to-text/get-models.js index 9073e18b..b73970ea 100644 --- a/speech-to-text/get-models.js +++ b/speech-to-text/get-models.js @@ -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) { diff --git a/text-to-speech/get-voices.js b/text-to-speech/get-voices.js index 7a5ccc7f..efea5323 100644 --- a/text-to-speech/get-voices.js +++ b/text-to-speech/get-voices.js @@ -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) { diff --git a/text-to-speech/synthesize.js b/text-to-speech/synthesize.js index be04f59b..d4ea0354 100644 --- a/text-to-speech/synthesize.js +++ b/text-to-speech/synthesize.js @@ -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(); }