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

chain33errori18n

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

chain33errori18n - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

8

dist/errorMsg.d.ts

@@ -5,11 +5,5 @@ export declare const docMsgs: any;

* @param {string} code 错误码
* @param {string} [lang='zh'] zh: 中午, en: 英文
* @returns
*/
/**
* @description 翻译chain33 接口错误码
* @param {string} code 错误码
* @param {string} [lang='zh'] zh: 中午, en: 英文
* @param {string} [lang='zh'] zh: 中文, en: 英文
* @returns {string} 译文,如果没有对应的译文则返回原文
*/
export default function errorMsg(code: string, lang?: string): string;

30

dist/errorMsg.js
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -99,3 +110,3 @@ exports.docMsgs = {

"ErrNewKeyPair": { "en": "New Key Pair", "zh": "创建私钥公钥对错误" },
"ErrPrivkeyToPub": { "en": "Privkey To Pub", "zh": "私钥生成公钥错误" },
"ErrPrivkeyToPub": { "en": "Privkey To Pub Error", "zh": "私钥生成公钥错误" },
"ErrNoExecerInMavlKey": { "en": "", "zh": "" },

@@ -176,12 +187,10 @@ "ErrMavlKeyNotStartWithMavl": { "en": "", "zh": "" },

};
// 补充错误码请写在这
var complementaryMsgs = {
"ErrPrivkeyToPub": { "en": "Privkey To Pub", "zh": "私钥生成公钥错误" },
};
/**
* @description 翻译chain33 接口错误码
* @param {string} code 错误码
* @param {string} [lang='zh'] zh: 中午, en: 英文
* @returns
*/
/**
* @description 翻译chain33 接口错误码
* @param {string} code 错误码
* @param {string} [lang='zh'] zh: 中午, en: 英文
* @param {string} [lang='zh'] zh: 中文, en: 英文
* @returns {string} 译文,如果没有对应的译文则返回原文

@@ -191,4 +200,5 @@ */

if (lang === void 0) { lang = 'zh'; }
if (exports.docMsgs[code] && exports.docMsgs[code][lang]) {
return exports.docMsgs[code][lang];
var msgs = __assign({}, exports.docMsgs, complementaryMsgs);
if (msgs[code] && msgs[code][lang]) {
return msgs[code][lang];
}

@@ -195,0 +205,0 @@ else {

{
"name": "chain33errori18n",
"version": "1.0.1",
"version": "1.0.2",
"description": "chain33 接口错误码中英文翻译",

@@ -5,0 +5,0 @@ "main": "dist/errorMsg.js",

## chain33 rpc 接口错误信息翻译
使用方式
### 使用方式

@@ -10,2 +10,12 @@ ```

let zh = errMsg('ErrDupTx', 'zh')
```
```
### 开发
#### 更新文档错误码
运行 ```npm run get-latest```
复制codeoutput.txt中生成的代码,覆盖到errorMsg.ts 的docMsgs中。
#### 补充文档中没有或错误的错误码
在 errorMsg.ts 的 complementaryMsgs 中补充,
**不要直接修改docMsgs中的代码,因为更新文档的错误码后会导致其中的修改消失**

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