bing-translate-api
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -32,3 +32,3 @@ // AUTO-GENERATED. SEE scripts/index.tpl.d.ts FOR ORIGINAL TYPINGS | ||
*/ | ||
from: string; | ||
from?: string; | ||
/** | ||
@@ -41,3 +41,3 @@ * The language code of translated text | ||
*/ | ||
score: number; | ||
score?: number; | ||
}; | ||
@@ -44,0 +44,0 @@ /** |
{ | ||
"name": "bing-translate-api", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "A simple and free API for Bing & Microsoft Translator for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -317,3 +317,3 @@ /** | ||
const translation = body[0].translations[0] | ||
const detectedLang = body[0].detectedLanguage | ||
const detectedLang = body[0].detectedLanguage || {} | ||
@@ -320,0 +320,0 @@ /** |
const { translate } = require('../src/index') | ||
const { maxTextLen, maxCorrectableTextLen, maxEPTTextLen, maxTextLenCN } = require('../src/config.json') | ||
/** | ||
* @param {import('..').TranslationResult} res | ||
*/ | ||
function printRes(res) { | ||
@@ -9,2 +12,5 @@ console.log(res.text, '---->', res.translation, 'fromLang', res.language.from) | ||
/** | ||
* @param {import('..').TranslationResult} res | ||
*/ | ||
function printCorrectRes(res) { | ||
@@ -15,2 +21,6 @@ console.log(res.text, '---->', res.correctedText) | ||
/** | ||
* @param {Error} e | ||
* @param {boolean} [notExit] | ||
*/ | ||
function onErr(e, notExit) { | ||
@@ -17,0 +27,0 @@ console.error(e) |
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
46327
1407