rxtutils 1.1.2-beta.16 → 1.1.2-beta.18
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,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./createGetter/index.cjs');
|
|
4
|
+
var index$1 = require('./createStateStore/index.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.createStoreGetter = index.createStoreGetter;
|
|
9
|
+
exports.createStoreGetterMemo = index.createStoreGetterMemo;
|
|
10
|
+
exports.createStateStore = index$1.default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var validator = require('./validator.cjs');
|
|
4
|
+
var decorators = require('./decorators.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.BaseValidator = validator.BaseValidator;
|
|
9
|
+
exports.VArray = decorators.VArray;
|
|
10
|
+
exports.VBoolean = decorators.VBoolean;
|
|
11
|
+
exports.VEmail = decorators.VEmail;
|
|
12
|
+
exports.VMax = decorators.VMax;
|
|
13
|
+
exports.VMaxLength = decorators.VMaxLength;
|
|
14
|
+
exports.VMin = decorators.VMin;
|
|
15
|
+
exports.VMinLength = decorators.VMinLength;
|
|
16
|
+
exports.VNumber = decorators.VNumber;
|
|
17
|
+
exports.VPattern = decorators.VPattern;
|
|
18
|
+
exports.VRequired = decorators.VRequired;
|
|
19
|
+
exports.VString = decorators.VString;
|
|
@@ -13,8 +13,8 @@ var BaseValidator = /** @class */ (function () {
|
|
|
13
13
|
*/
|
|
14
14
|
function BaseValidator() {
|
|
15
15
|
/** 用于存储验证器映射的私有符号 */
|
|
16
|
-
this.__keySymbol = Symbol(
|
|
17
|
-
this.__keySymbol = Symbol(
|
|
16
|
+
this.__keySymbol = Symbol("key-description");
|
|
17
|
+
this.__keySymbol = Symbol("key-description");
|
|
18
18
|
this[this.__keySymbol] = {};
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -133,14 +133,14 @@ var BaseValidator = /** @class */ (function () {
|
|
|
133
133
|
return { status: true };
|
|
134
134
|
}
|
|
135
135
|
else {
|
|
136
|
-
var msg =
|
|
137
|
-
if (typeof message ===
|
|
136
|
+
var msg = "";
|
|
137
|
+
if (typeof message === "function") {
|
|
138
138
|
msg = message(val, value, context);
|
|
139
139
|
}
|
|
140
140
|
else {
|
|
141
141
|
msg = message;
|
|
142
142
|
}
|
|
143
|
-
return { status: false, message: msg };
|
|
143
|
+
return { name: name, status: false, message: msg };
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
if (validators[name]) {
|
|
@@ -11,8 +11,8 @@ var BaseValidator = /** @class */ (function () {
|
|
|
11
11
|
*/
|
|
12
12
|
function BaseValidator() {
|
|
13
13
|
/** 用于存储验证器映射的私有符号 */
|
|
14
|
-
this.__keySymbol = Symbol(
|
|
15
|
-
this.__keySymbol = Symbol(
|
|
14
|
+
this.__keySymbol = Symbol("key-description");
|
|
15
|
+
this.__keySymbol = Symbol("key-description");
|
|
16
16
|
this[this.__keySymbol] = {};
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
@@ -131,14 +131,14 @@ var BaseValidator = /** @class */ (function () {
|
|
|
131
131
|
return { status: true };
|
|
132
132
|
}
|
|
133
133
|
else {
|
|
134
|
-
var msg =
|
|
135
|
-
if (typeof message ===
|
|
134
|
+
var msg = "";
|
|
135
|
+
if (typeof message === "function") {
|
|
136
136
|
msg = message(val, value, context);
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
139
|
msg = message;
|
|
140
140
|
}
|
|
141
|
-
return { status: false, message: msg };
|
|
141
|
+
return { name: name, status: false, message: msg };
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
144
|
if (validators[name]) {
|