@a-a-game-studio/aa-components
Advanced tools
Comparing version 1.1.43 to 1.1.44
@@ -43,2 +43,7 @@ import { ModelRulesT } from ".."; | ||
/** | ||
* @param function name(v:any,k?:string) { | ||
* @return ModelOneRuleC | ||
*/ | ||
beforeAction(fAction: Function): ModelOneRuleC; | ||
/** | ||
* @param boolean bDef - если присланно неверно - установить по умолчанию | ||
@@ -45,0 +50,0 @@ * @return ModelOneRuleC |
@@ -86,2 +86,10 @@ "use strict"; | ||
/** | ||
* @param function name(v:any,k?:string) { | ||
* @return ModelOneRuleC | ||
*/ | ||
ModelOneRuleC.prototype.beforeAction = function (fAction) { | ||
this.aRule.before_action = fAction; | ||
return this; | ||
}; | ||
/** | ||
* @param boolean bDef - если присланно неверно - установить по умолчанию | ||
@@ -88,0 +96,0 @@ * @return ModelOneRuleC |
@@ -21,2 +21,3 @@ /** Типы валидации */ | ||
less_or_equal?: number; | ||
before_action?: Function; | ||
} | ||
@@ -23,0 +24,0 @@ /** Типы валидации */ |
@@ -60,2 +60,11 @@ "use strict"; | ||
var bExist = this.vValidatorTask.checkExist(this.data[k]); | ||
// Выполнение предварительного действия | ||
if (bExist && v.before_action) { | ||
try { | ||
this.data[k] = v.before_action(this.data[k], k); | ||
} | ||
catch (e) { | ||
this.errorSys.error('valid_before_action_' + k, 'Предварительное действие перед проверкой не выполненно'); | ||
} | ||
} | ||
// Проверка зависимостей | ||
@@ -62,0 +71,0 @@ var bDpend = true; |
{ | ||
"name": "@a-a-game-studio/aa-components", | ||
"version": "1.1.43", | ||
"version": "1.1.44", | ||
"description": "node typescript base class", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
169549
3126