translatte
Advanced tools
Comparing version 2.4.3 to 2.4.4
13
index.js
@@ -132,3 +132,3 @@ const querystring = require('querystring'); | ||
'api-version': '3.0', | ||
from: opts.from, | ||
from: opts.from === 'auto' ? '' : opts.from, | ||
to: opts.to | ||
@@ -141,9 +141,5 @@ }); | ||
'Ocp-Apim-Subscription-Key': opts.services['microsoft_v3']['key'], | ||
'Content-type': 'application/json', | ||
'X-ClientTraceId': ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => | ||
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)) | ||
'Content-type': 'application/json' | ||
}, | ||
body: { | ||
text: [text] | ||
}, | ||
body: [{text}], | ||
json: true, | ||
@@ -153,2 +149,5 @@ timeout: 10000 | ||
for (const translation of body) { | ||
if (translation.detectedLanguage && translation.detectedLanguage.language) { | ||
result.from.language.iso = translation.detectedLanguage.language; | ||
} | ||
result.text += result.text | ||
@@ -155,0 +154,0 @@ ? ' ' + translation.translations[0].text |
{ | ||
"name": "translatte", | ||
"version": "2.4.3", | ||
"version": "2.4.4", | ||
"description": "A free and unlimited translate for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
641544
569