Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@a-a-game-studio/aa-components

Package Overview
Dependencies
Maintainers
3
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@a-a-game-studio/aa-components - npm Package Compare versions

Comparing version 1.1.45 to 1.1.46

lib/sh/publish.sh

4

lib/index.d.ts

@@ -7,5 +7,5 @@ import { ErrorSys } from "./ErrorSys/ErrorSys";

import { ModelRulesC } from "./ModelValidatorSys/ModelRulesC";
import { ModelRulesT } from "./ModelValidatorSys/ModelRulesE";
import { ModelRulesT, TCustomFn } from "./ModelValidatorSys/ModelRulesE";
import { BaseClass } from "./BaseClass";
import { FieldValidator } from "./FieldValidator/FieldValidator";
export { ErrorSys, ErrorT, ErrorMsgT, SimpleI, FieldValidator, ModelValidatorSys, ModelOneRuleC, ModelRulesC, ModelRulesT, BaseClass, };
export { ErrorSys, ErrorT, ErrorMsgT, SimpleI, FieldValidator, ModelValidatorSys, ModelOneRuleC, ModelRulesC, ModelRulesT, BaseClass, TCustomFn, };
import { ModelRulesT } from "..";
import { TCustomFn } from "./ModelRulesE";
/**

@@ -115,2 +116,6 @@ * Класс конструирующий правила для одного поля

/**
* Кастомная валидация
*/
custom(fnVal: TCustomFn): ModelOneRuleC;
/**
* Получить правило

@@ -117,0 +122,0 @@ *

@@ -197,2 +197,9 @@ "use strict";

/**
* Кастомная валидация
*/
ModelOneRuleC.prototype.custom = function (fnVal) {
this.aRule.custom = fnVal;
return this;
};
/**
* Получить правило

@@ -199,0 +206,0 @@ *

@@ -0,1 +1,3 @@

import { ErrorSys } from '../ErrorSys/ErrorSys';
export declare type TCustomFn = (data: any, errorSys: ErrorSys) => boolean;
/** Типы валидации */

@@ -21,2 +23,3 @@ export interface ModelRulesI {

less_or_equal?: number;
custom?: TCustomFn;
before_action?: Function;

@@ -23,0 +26,0 @@ }

@@ -146,2 +146,6 @@ import { ErrorSys } from '../ErrorSys/ErrorSys';

private fMinLen;
/**
* Кастомная валидация
*/
private fCustom;
}

@@ -145,2 +145,5 @@ "use strict";

}
if (bExist && 'custom' in v) {
this.fCustom(k, v);
}
// ============================================

@@ -460,2 +463,13 @@ // Если поле обязательно, но указанно неправильно - подставить значение по умолчанию если есть

};
/**
* Кастомная валидация
*/
ModelValidatorSys.prototype.fCustom = function (kRule, vRule) {
this.okResult = vRule.custom(this.data[kRule], this.errorSys);
if (this.okResult) {
this.abValidOK[kRule] = true;
this.aResult[kRule] = this.data[kRule];
}
return true;
};
return ModelValidatorSys;

@@ -462,0 +476,0 @@ }());

{
"name": "@a-a-game-studio/aa-components",
"version": "1.1.45",
"version": "1.1.46",
"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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc