mm_expand 2.1.4 → 2.1.6
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.
- package/lib/lang.js +9 -10
- package/lib/validator.js +1 -1
- package/package.json +1 -1
package/lib/lang.js
CHANGED
|
@@ -22,15 +22,6 @@ class Lang extends Base {
|
|
|
22
22
|
// 是否为插件
|
|
23
23
|
this.is_plugin = false;
|
|
24
24
|
|
|
25
|
-
// 当前选择语言
|
|
26
|
-
this.now = 'zh_cn';
|
|
27
|
-
|
|
28
|
-
// 语言区域映射表
|
|
29
|
-
this.locale = {
|
|
30
|
-
'zh': 'zh_cn',
|
|
31
|
-
'en': 'en'
|
|
32
|
-
};
|
|
33
|
-
|
|
34
25
|
// 复数规则配置
|
|
35
26
|
this.rules = {
|
|
36
27
|
'en': function (count) {
|
|
@@ -50,9 +41,17 @@ Lang.prototype._preset = function () {
|
|
|
50
41
|
// 初始化默认语言
|
|
51
42
|
this.now = this.config.default || 'zh_cn';
|
|
52
43
|
let config = this.config;
|
|
44
|
+
let locale = this.locale || {
|
|
45
|
+
'zh': 'zh_cn',
|
|
46
|
+
'en': 'en'
|
|
47
|
+
};
|
|
53
48
|
// 设置区域映射表
|
|
54
49
|
if (config.locale) {
|
|
55
|
-
|
|
50
|
+
// 语言区域映射表
|
|
51
|
+
this.locale = Object.assign(locale, config.locale);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this.locale = locale;
|
|
56
55
|
}
|
|
57
56
|
};
|
|
58
57
|
|
package/lib/validator.js
CHANGED
|
@@ -203,7 +203,7 @@ class Validator extends Base {
|
|
|
203
203
|
* 初始化验证规则
|
|
204
204
|
* @description 初始化验证规则,避免污染
|
|
205
205
|
*/
|
|
206
|
-
Validator.prototype.
|
|
206
|
+
Validator.prototype.reset = function () {
|
|
207
207
|
// 初始化验证规则,避免污染
|
|
208
208
|
Object.assign(this._format, Validator.format);
|
|
209
209
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_expand",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "Super Meimei Prototype Function Extension Module - Enhanced operations for string, array, object, date manipulation with error prevention and simplified business logic.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|