Skip to main content

ts-transforms / operations/plugins/validator / Validator

Class: Validator

Extends

Constructors

new Validator()

new Validator(config, method): Validator

Parameters

ParameterType
configPostProcessConfig
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

Validator

Overrides

default.constructor

Source

operations/plugins/validator/index.ts:10

Properties

config

readonly config: OperationConfig

Inherited from

default.config

Source

operations/lib/base.ts:9


destination

protected destination: string | string[]

Inherited from

default.destination

Source

operations/lib/base.ts:10


hasTarget

protected hasTarget: boolean

Inherited from

default.hasTarget

Source

operations/lib/base.ts:11


source

protected source: string | string[]

Inherited from

default.source

Source

operations/lib/base.ts:7


target

protected target: string | string[]

Inherited from

default.target

Source

operations/lib/base.ts:8


cardinality

static cardinality: InputOutputCardinality = 'one-to-one'

Inherited from

default.cardinality

Source

operations/lib/base.ts:13

Methods

normalize()?

optional normalize(data, _doc): any

Parameters

ParameterType
dataany
_docDataEntity<Record<string, any>, _DataEntityMetadata<Record<string, any>>>

Returns

any

Inherited from

default.normalize

Source

operations/lib/validations/base.ts:16


removeField()

removeField(doc, field): void

Parameters

ParameterType
docDataEntity<Record<string, any>, _DataEntityMetadata<Record<string, any>>>
fieldstring

Returns

void

Inherited from

default.removeField

Source

operations/lib/base.ts:50


removeSource()

removeSource(doc): void

Parameters

ParameterType
docDataEntity<Record<string, any>, _DataEntityMetadata<Record<string, any>>>

Returns

void

Inherited from

default.removeSource

Source

operations/lib/base.ts:46


run()

run(doc): null | DataEntity<Record<string, any>, _DataEntityMetadata<Record<string, any>>>

Parameters

ParameterType
docDataEntity<Record<string, any>, _DataEntityMetadata<Record<string, any>>>

Returns

null | DataEntity<Record<string, any>, _DataEntityMetadata<Record<string, any>>>

Inherited from

default.run

Source

operations/lib/validations/base.ts:18


set()

set(doc, data): void

Parameters

ParameterType
docDataEntity<Record<string, any>, _DataEntityMetadata<Record<string, any>>>
dataany

Returns

void

Inherited from

default.set

Source

operations/lib/base.ts:38


setField()

setField(doc, field, data): void

Parameters

ParameterType
docDataEntity<Record<string, any>, _DataEntityMetadata<Record<string, any>>>
fieldstring
dataany

Returns

void

Inherited from

default.setField

Source

operations/lib/base.ts:42


validate()

validate(value): any

Parameters

ParameterType
valueany

Returns

any

Overrides

default.validate

Source

operations/plugins/validator/index.ts:16


validateConfig()

protected validateConfig(config): void

Parameters

ParameterType
configOperationConfig

Returns

void

Inherited from

default.validateConfig

Source

operations/lib/base.ts:22