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

@jswork/next-fanyi-api-sign

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jswork/next-fanyi-api-sign - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

dist/index.esm.js

62

dist/index.js
/*!
* name: @jswork/next-fanyi-api-sign
* description: Get baidu translate api sign.
* homepage: https://github.com/afeiship/next-fanyi-api-sign
* version: 1.0.0
* date: 2020-11-22 17:46:22
* homepage: https://js.work
* version: 1.0.1
* date: 2023-05-17 10:20:52
* license: MIT
*/
(function () {
var global = global || this || window || Function('return this')();
var nx = global.nx || require('@jswork/next');
var md5 = require('md5');
var DEFAULT_OPTIONS = {
q: 'apple',
salt: Math.random().toString(36),
appid: '20191225000369703',
secret: '_m5Ircd6tovvjicHKyMh'
};
'use strict';
nx.fanyiApiSign = function (inOptions) {
var options = nx.mix(null, DEFAULT_OPTIONS, inOptions);
var q = options.q;
var salt = options.salt;
var secret = options.secret;
var appid = options.appid;
var res = appid + q + salt + secret;
return nx.mix(options, { sign: md5(res) });
};
if (typeof module !== 'undefined' && module.exports) {
module.exports = nx.fanyiApiSign;
}
})();
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = void 0;
var _next = _interopRequireDefault(require('@jswork/next'));
var _md = _interopRequireDefault(require('md5'));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
var defaults = {
q: 'apple',
salt: Math.random().toString(36),
appid: process.env.BAIDU_FANYI_APP_ID,
secret: process.env.BAIDU_FANYI_SECRET
};
_next['default'].fanyiApiSign = function (inOptions) {
var options = _next['default'].mix(null, defaults, inOptions);
var q = options.q;
var salt = options.salt;
var secret = options.secret;
var appid = options.appid;
var res = appid + q + salt + secret;
return _next['default'].mix(options, {
sign: (0, _md['default'])(res)
});
};
if (typeof module !== 'undefined' && module.exports) {
module.exports = _next['default'].fanyiApiSign;
}
var _default = _next['default'].fanyiApiSign;
exports['default'] = _default;
{
"name": "@jswork/next-fanyi-api-sign",
"version": "1.0.0",
"version": "1.0.1",
"description": "Get baidu translate api sign.",
"homepage": "https://github.com/afeiship/next-fanyi-api-sign",
"homepage": "https://js.work",
"author": {

@@ -17,22 +17,30 @@ "name": "afei",

"main": "dist/index.js",
"module": "dist/index.esm.js",
"license": "MIT",
"devDependencies": {
"@jswork/gulp-pkg-header": "^1.0.2",
"@jswork/next": "^1.0.2",
"@jswork/next-param": "^1.0.0",
"@babel/core": "^7.21.3",
"@babel/preset-env": "^7.20.2",
"@jswork/gulp-pkg-header": "^1.0.8",
"@jswork/gulp-registry": "^1.0.22",
"@jswork/next": "^1.1.7",
"@jswork/next-param": "^1.0.11",
"del": "^6.0.0",
"gulp": "^4.0.2",
"gulp-debug": "^4.0.0",
"gulp-header": "^2.0.9",
"gulp-ignore": "^3.0.0",
"gulp-load-plugins": "^2.0.5",
"gulp-babel": "^8.0.0",
"gulp-prettier": "^4.0.0",
"gulp-rename": "^2.0.0",
"gulp-size": "^3.0.0",
"gulp-replace": "^1.1.4",
"gulp-uglify": "^3.0.2",
"jest": "^26.6.3",
"prettier": "^2.1.2",
"release-it": "^14.2.1",
"uglify-js": "3.11.6",
"jest": "^29.5.0",
"jest-location-mock": "^1.0.9",
"node-fetch": "2.6.7",
"uglify-save-license": "^0.4.1"
},
"babel": {
"presets": [
[
"@babel/preset-env"
]
]
},
"publishConfig": {

@@ -43,12 +51,4 @@ "access": "public",

"dependencies": {
"md5": "^2.3.0",
"node-fetch": "^2.6.1"
},
"keywords": [
"next",
"fanyi",
"baidu",
"api",
"sign"
]
}
"md5": "^2.3.0"
}
}
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