phecda-core 2.0.0-alpha.0 → 2.0.0-alpha.1
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/dist/index.d.ts +1 -1
- package/dist/index.global.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ declare function addDecoToClass<M extends new (...args: any) => any>(c: M, key:
|
|
|
77
77
|
|
|
78
78
|
declare function Init(target: any, key: PropertyKey): void;
|
|
79
79
|
declare function Bind(value: any): (target: any, k: PropertyKey) => void;
|
|
80
|
-
declare function Rule(rule: RegExp | string | Function | number, info: string, meta?: any): (obj: any, key: PropertyKey) => void;
|
|
80
|
+
declare function Rule(rule: RegExp | string | Function | number, info: string | ((k: string) => string), meta?: any): (obj: any, key: PropertyKey) => void;
|
|
81
81
|
declare function Ignore(target: any, key: PropertyKey): void;
|
|
82
82
|
declare function Clear(target: any, key: PropertyKey): void;
|
|
83
83
|
declare function Err<Fn extends (...args: any) => any>(cb: Fn): (target: any, key: PropertyKey) => void;
|
package/dist/index.global.js
CHANGED
|
@@ -412,7 +412,7 @@ var Phecda = (() => {
|
|
|
412
412
|
for (const handler of handlers) {
|
|
413
413
|
const rule = handler.rule;
|
|
414
414
|
if (rule && !await validate(rule, data[item])) {
|
|
415
|
-
err.push(handler.info
|
|
415
|
+
err.push(typeof handler.info === "function" ? handler.info(item) : handler.info);
|
|
416
416
|
if (!options.collectError)
|
|
417
417
|
break;
|
|
418
418
|
}
|
package/dist/index.js
CHANGED
|
@@ -412,7 +412,7 @@ async function plainToClass(Model, input, options = {}) {
|
|
|
412
412
|
for (const handler of handlers) {
|
|
413
413
|
const rule = handler.rule;
|
|
414
414
|
if (rule && !await validate(rule, data[item])) {
|
|
415
|
-
err.push(handler.info
|
|
415
|
+
err.push(typeof handler.info === "function" ? handler.info(item) : handler.info);
|
|
416
416
|
if (!options.collectError)
|
|
417
417
|
break;
|
|
418
418
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -339,7 +339,7 @@ async function plainToClass(Model, input, options = {}) {
|
|
|
339
339
|
for (const handler of handlers) {
|
|
340
340
|
const rule = handler.rule;
|
|
341
341
|
if (rule && !await validate(rule, data[item])) {
|
|
342
|
-
err.push(handler.info
|
|
342
|
+
err.push(typeof handler.info === "function" ? handler.info(item) : handler.info);
|
|
343
343
|
if (!options.collectError)
|
|
344
344
|
break;
|
|
345
345
|
}
|