Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentranslate2/baidu-domain

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentranslate2/baidu-domain - npm Package Compare versions

Comparing version 1.4.4 to 1.4.6

2

dist/index.d.ts
import { Language, Translator, TranslateQueryResult } from "@opentranslate2/translator";
export declare const domains: string[];
export type Domain = typeof domains[number];
export declare type Domain = typeof domains[number];
export interface BaiduDomainConfig {

@@ -5,0 +5,0 @@ appid: string;

@@ -16,4 +16,7 @@ "use strict";

class BaiduDomain extends translator_1.Translator {
name = "baidu-domain";
endpoint = "https://fanyi-api.baidu.com/api/trans/vip/fieldtranslate";
constructor() {
super(...arguments);
this.name = "baidu-domain";
this.endpoint = "https://fanyi-api.baidu.com/api/trans/vip/fieldtranslate";
}
async query(text, from, to, config) {

@@ -31,3 +34,3 @@ const salt = Date.now();

domain,
sign: (0, md5_1.default)(appid + text + salt + domain + key)
sign: md5_1.default(appid + text + salt + domain + key)
}

@@ -69,6 +72,2 @@ }).catch(() => {

}
/** Translator lang to custom lang */
static langMap = new Map(langMap);
/** Custom lang to translator lang */
static langMapReverse = new Map(langMap.map(([translatorLang, lang]) => [lang, translatorLang]));
getSupportLanguages() {

@@ -86,3 +85,7 @@ return [...BaiduDomain.langMap.keys()];

exports.BaiduDomain = BaiduDomain;
/** Translator lang to custom lang */
BaiduDomain.langMap = new Map(langMap);
/** Custom lang to translator lang */
BaiduDomain.langMapReverse = new Map(langMap.map(([translatorLang, lang]) => [lang, translatorLang]));
exports.default = BaiduDomain;
//# sourceMappingURL=index.js.map

@@ -7,3 +7,3 @@ {

},
"version": "1.4.4",
"version": "1.4.6",
"description": "Baidu domain translator with OpenTranslate API.",

@@ -27,4 +27,4 @@ "main": "dist/index.js",

"dependencies": {
"@opentranslate2/translator": "^1.4.4"
"@opentranslate2/translator": "^1.4.6"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc