@steedos/i18n 2.5.3-beta.15 → 2.5.3-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clearCacher = exports.getCacher = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* @Author: baozhoutao@steedos.com
|
|
6
|
+
* @Date: 2022-06-09 15:03:56
|
|
7
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
8
|
+
* @LastEditTime: 2022-06-09 15:47:58
|
|
9
|
+
* @Description:
|
|
10
|
+
*/
|
|
11
|
+
var CACHER_MAP = {};
|
|
12
|
+
var getCacher = function (name) {
|
|
13
|
+
if (!CACHER_MAP[name]) {
|
|
14
|
+
CACHER_MAP[name] = new Cacher();
|
|
15
|
+
}
|
|
16
|
+
return CACHER_MAP[name];
|
|
17
|
+
};
|
|
18
|
+
exports.getCacher = getCacher;
|
|
19
|
+
var clearCacher = function (name) {
|
|
20
|
+
if (CACHER_MAP[name]) {
|
|
21
|
+
CACHER_MAP[name].clear();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.clearCacher = clearCacher;
|
|
25
|
+
var Cacher = /** @class */ (function () {
|
|
26
|
+
function Cacher() {
|
|
27
|
+
this.cache = {};
|
|
28
|
+
this.hit = 0;
|
|
29
|
+
this.count = 0;
|
|
30
|
+
}
|
|
31
|
+
Cacher.prototype.getHitRate = function () {
|
|
32
|
+
return (this.hit / this.count * 100).toFixed(2) + "%";
|
|
33
|
+
};
|
|
34
|
+
Cacher.prototype.get = function (key) {
|
|
35
|
+
var data = this.cache[key];
|
|
36
|
+
this.count++;
|
|
37
|
+
if (data) {
|
|
38
|
+
this.hit++;
|
|
39
|
+
}
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
Cacher.prototype.set = function (key, value) {
|
|
43
|
+
this.cache[key] = value;
|
|
44
|
+
};
|
|
45
|
+
Cacher.prototype.clear = function () {
|
|
46
|
+
this.cache = {};
|
|
47
|
+
};
|
|
48
|
+
return Cacher;
|
|
49
|
+
}());
|
|
50
|
+
//# sourceMappingURL=cacher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacher.js","sourceRoot":"","sources":["../../src/translations/cacher.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,IAAM,UAAU,GAAG,EAAE,CAAC;AAEf,IAAM,SAAS,GAAG,UAAU,IAAY;IAC3C,IAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAC;QACjB,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,MAAM,EAAE,CAAC;KACnC;IACD,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAA;AALY,QAAA,SAAS,aAKrB;AAEM,IAAM,WAAW,GAAG,UAAU,IAAqB;IACtD,IAAG,UAAU,CAAC,IAAI,CAAC,EAAC;QAChB,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;KAC5B;AACL,CAAC,CAAA;AAJY,QAAA,WAAW,eAIvB;AAED;IAII;QACI,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACnB,CAAC;IACD,2BAAU,GAAV;QACI,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IAC1D,CAAC;IACD,oBAAG,GAAH,UAAI,GAAW;QACX,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,EAAG,CAAE;QACf,IAAG,IAAI,EAAC;YACJ,IAAI,CAAC,GAAG,EAAG,CAAC;SACf;QACD,OAAO,IAAI,CAAA;IACf,CAAC;IACD,oBAAG,GAAH,UAAI,GAAW,EAAE,KAAU;QACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC5B,CAAC;IACD,sBAAK,GAAL;QACI,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;IACnB,CAAC;IACL,aAAC;AAAD,CAAC,AA1BD,IA0BC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/i18n",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.5.3-beta.
|
|
4
|
+
"version": "2.5.3-beta.16",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"scripts": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"author": "",
|
|
12
12
|
"license": "ISC",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@steedos/cachers": "2.5.3-beta.
|
|
14
|
+
"@steedos/cachers": "2.5.3-beta.16",
|
|
15
15
|
"i18next": "^19.3.4",
|
|
16
16
|
"i18next-sprintf-postprocessor": "^0.2.2",
|
|
17
17
|
"underscore": "1.13.4"
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "ef2a20e8380004854e0428016d3468c4b5ea7c0b"
|
|
26
26
|
}
|
|
@@ -1935,12 +1935,12 @@ CustomLabels:
|
|
|
1935
1935
|
process_delegation_rules_end_time: End Time
|
|
1936
1936
|
process_delegation_rules_start_must_lt_end: Strat time must less than end time
|
|
1937
1937
|
process_delegation_rules_description: "{$userName} delegated"
|
|
1938
|
+
process_delegation_rules_time_repeat: Please confirm that the order period overlaps with other request periods.
|
|
1938
1939
|
process_delegation_rules_cannot_deltegation_eachother: Only allow one-way delegation
|
|
1939
1940
|
instance_handler_name: Handler
|
|
1940
1941
|
instance_handler_organization_fullname: Organization
|
|
1941
1942
|
instance_approve_timeout_auto_submitted: Timeout auto submitted
|
|
1942
1943
|
categories_in_use: Category is in use and cannot be deleted
|
|
1943
|
-
process_delegation_rules_only_one: You already set process delegation rule
|
|
1944
1944
|
instance_approve_modal_modificationsave: saved
|
|
1945
1945
|
instance_print_traces_simplify: Simplify
|
|
1946
1946
|
instance_print_a4_vertical: A4Vertical
|
|
@@ -1783,12 +1783,12 @@ CustomLabels:
|
|
|
1783
1783
|
process_delegation_rules_end_time: 委托结束
|
|
1784
1784
|
process_delegation_rules_start_must_lt_end: 开始时间应小于结束时间
|
|
1785
1785
|
process_delegation_rules_description: "{$userName}委托"
|
|
1786
|
+
process_delegation_rules_time_repeat: 委托时间段与其他委托时间段有重叠,请确认。
|
|
1786
1787
|
process_delegation_rules_cannot_deltegation_eachother: 只允许单向委托, 请更换被委托人或者调整委托时间
|
|
1787
1788
|
instance_handler_name: 处理人
|
|
1788
1789
|
instance_handler_organization_fullname: 部门
|
|
1789
1790
|
instance_approve_timeout_auto_submitted: 超时自动跳过
|
|
1790
1791
|
categories_in_use: 分类在使用中,不能删除
|
|
1791
|
-
process_delegation_rules_only_one: 您已设置委托规则,修改即可
|
|
1792
1792
|
instance_approve_modal_modificationsave: 您的修改保存成功
|
|
1793
1793
|
instance_print_traces_simplify: 精简
|
|
1794
1794
|
instance_print_a4_vertical: A4纵向
|