@sheinx/hooks 3.1.19 → 3.1.20
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-rule.d.ts","sourceRoot":"","sources":["get-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"get-rule.d.ts","sourceRoot":"","sources":["get-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAO/C,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EACnC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,EACjC,KAAK,EAAE,UAAU,GAChB,SAAS,CAAC,KAAK,CAAC,CAuGlB"}
|
@@ -8,6 +8,7 @@ var _nullable = _interopRequireDefault(require("./nullable"));
|
|
8
8
|
var _is = require("../is");
|
9
9
|
var _type = _interopRequireDefault(require("./type"));
|
10
10
|
var _error = require("./error");
|
11
|
+
var _string = require("../string");
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
13
|
function getRule(rule, props) {
|
13
14
|
var po = props;
|
@@ -30,7 +31,7 @@ function getRule(rule, props) {
|
|
30
31
|
max: max,
|
31
32
|
args: args
|
32
33
|
});
|
33
|
-
po.message = typeof message === 'function' ? message(po) : message;
|
34
|
+
po.message = typeof message === 'function' ? message(po) : (0, _string.substitute)(message, po);
|
34
35
|
var cb = function cb() {};
|
35
36
|
if (func) {
|
36
37
|
cb = function cb(value, formData, callback) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-rule.d.ts","sourceRoot":"","sources":["get-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"get-rule.d.ts","sourceRoot":"","sources":["get-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAO/C,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EACnC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,EACjC,KAAK,EAAE,UAAU,GAChB,SAAS,CAAC,KAAK,CAAC,CAuGlB"}
|
@@ -2,6 +2,7 @@ import nullable from "./nullable";
|
|
2
2
|
import { isEmpty } from "../is";
|
3
3
|
import typeOf from "./type";
|
4
4
|
import { FormError } from "./error";
|
5
|
+
import { substitute } from "../string";
|
5
6
|
export default function getRule(rule, props) {
|
6
7
|
var po = props;
|
7
8
|
var rulePo = rule;
|
@@ -23,7 +24,7 @@ export default function getRule(rule, props) {
|
|
23
24
|
max: max,
|
24
25
|
args: args
|
25
26
|
});
|
26
|
-
po.message = typeof message === 'function' ? message(po) : message;
|
27
|
+
po.message = typeof message === 'function' ? message(po) : substitute(message, po);
|
27
28
|
var cb = function cb() {};
|
28
29
|
if (func) {
|
29
30
|
cb = function cb(value, formData, callback) {
|