ts-transforms / operations/plugins/validator / Validator
Class: Validator
Extends
default
<any
>
Constructors
new Validator()
new Validator(
config
,method
):Validator
Parameters
Parameter | Type |
---|---|
config | PostProcessConfig |
method | "toString" | "default" | "contains" | "equals" | "isAbaRouting" | "isAfter" | "isAlpha" | "isAlphanumeric" | "isAscii" | "isBase32" | "isBase58" | "isBase64" | "isBefore" | "isBIC" | "isByteLength" | "isCreditCard" | "isCurrency" | "isEthereumAddress" | "isBtcAddress" | "isDataURI" | "isDate" | "isDecimal" | "isDivisibleBy" | "isMailtoURI" | "isEmpty" | "isFloat" | "isFullWidth" | "isHalfWidth" | "isHash" | "isHexadecimal" | "isHexColor" | "isHSL" | "isRgbColor" | "isIdentityCard" | "isIMEI" | "isIn" | "isInt" | "isIP" | "isIPRange" | "isISBN" | "isEAN" | "isISIN" | "isISO31661Alpha3" | "isISO6346" | "isISO8601" | "isISSN" | "isISRC" | "isRFC3339" | "isJSON" | "isJWT" | "isLatLong" | "isLength" | "isLicensePlate" | "isLocale" | "isLowercase" | "isLuhnNumber" | "isMACAddress" | "isMagnetURI" | "isMD5" | "isMimeType" | "isMobilePhone" | "isMongoId" | "isMultibyte" | "isNumeric" | "isOctal" | "isPassportNumber" | "isPort" | "isPostalCode" | "isSemVer" | "isStrongPassword" | "isSurrogatePair" | "isTime" | "isUppercase" | "isUUID" | "isVariableWidth" | "isVAT" | "isWhitelisted" | "matches" | "isSlug" | "blacklist" | "escape" | "unescape" | "ltrim" | "normalizeEmail" | "rtrim" | "stripLow" | "toBoolean" | "toDate" | "toFloat" | "toInt" | "trim" | "whitelist" | "version" | "isAlphaLocales" | "isAlphanumericLocales" | "isIBAN" | "ibanLocales" | "isBoolean" | "isEmail" | "isFloatLocales" | "isFQDN" | "isISO31661Alpha2" | "isFreightContainerID" | "isISO6391" | "isISO4217" | "isMobilePhoneLocales" | "isPostalCodeLocales" | "isURL" | "isTaxID" | "_default" |
Returns
Overrides
Source
operations/plugins/validator/index.ts:10
Properties
config
readonly
config:OperationConfig
Inherited from
Source
destination
protected
destination:string
|string
[]
Inherited from
Source
hasTarget
protected
hasTarget:boolean
Inherited from
Source
source
protected
source:string
|string
[]
Inherited from
Source
target
protected
target:string
|string
[]
Inherited from
Source
cardinality
static
cardinality:InputOutputCardinality
='one-to-one'
Inherited from
Source
Methods
normalize()?
optional
normalize(data
,_doc
):any
Parameters
Parameter | Type |
---|---|
data | any |
_doc | DataEntity <Record <string , any >, _DataEntityMetadata <Record <string , any >>> |
Returns
any
Inherited from
Source
operations/lib/validations/base.ts:16
removeField()
removeField(
doc
,field
):void
Parameters
Parameter | Type |
---|---|
doc | DataEntity <Record <string , any >, _DataEntityMetadata <Record <string , any >>> |
field | string |
Returns
void
Inherited from
Source
removeSource()
removeSource(
doc
):void
Parameters
Parameter | Type |
---|---|
doc | DataEntity <Record <string , any >, _DataEntityMetadata <Record <string , any >>> |
Returns
void
Inherited from
Source
run()
run(
doc
):null
|DataEntity
<Record
<string
,any
>,_DataEntityMetadata
<Record
<string
,any
>>>
Parameters
Parameter | Type |
---|---|
doc | DataEntity <Record <string , any >, _DataEntityMetadata <Record <string , any >>> |
Returns
null
| DataEntity
<Record
<string
, any
>, _DataEntityMetadata
<Record
<string
, any
>>>
Inherited from
Source
operations/lib/validations/base.ts:18
set()
set(
doc
,data
):void
Parameters
Parameter | Type |
---|---|
doc | DataEntity <Record <string , any >, _DataEntityMetadata <Record <string , any >>> |
data | any |
Returns
void
Inherited from
Source
setField()
setField(
doc
,field
,data
):void
Parameters
Parameter | Type |
---|---|
doc | DataEntity <Record <string , any >, _DataEntityMetadata <Record <string , any >>> |
field | string |
data | any |
Returns
void
Inherited from
Source
validate()
validate(
value
):any
Parameters
Parameter | Type |
---|---|
value | any |
Returns
any
Overrides
Source
operations/plugins/validator/index.ts:16
validateConfig()
protected
validateConfig(config
):void
Parameters
Parameter | Type |
---|---|
config | OperationConfig |
Returns
void