Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StringProp

A String property. This will validate the value it is connected with and render it down

Hierarchy

Indexable

[key: string]: any

A String property. This will validate the value it is connected with and render it down

Index

Constructors

constructor

  • new StringProp(node: any, name: string): StringProp

Properties

Optional IsAlphanumeric

IsAlphanumeric: undefined | false | true

Checks if the string contains only letters and numbers

classSourcePath

classSourcePath: string | null

The path to the the prooperty from the base property

Optional contains

contains: undefined | string

Checks if the string contains the seed.

Optional defaultValue

defaultValue: any

A default value for the property

Optional description

description: undefined | string

Detailed documentation

Optional empty

empty: any

Checks if given value is empty (=== '', === null, === undefined).

Optional equals

equals: any

Checks if value equals ("===") comparison

Optional isAlpha

isAlpha: undefined | false | true

Checks if the string contains only letters (a-zA-Z).

Optional isAscii

isAscii: undefined | false | true

Checks if the string contains ASCII chars only.

Optional isBase64

isBase64: undefined | false | true

Checks if a string is base64 encoded.

Optional isBooleanString

isBooleanString: undefined | false | true

Checks if a string is a boolean (e.g. is "true" or "false").

Optional isDateString

isDateString: undefined | false | true

Checks if a string is a complete representation of a date (e.g. "2017-06-07T14:34:08.700Z", "2017-06-07T14:34:08.700 or "2017-06-07T14:34:08+04:00").

Optional isDefined

isDefined: any

Checks if value is defined (!== undefined, !== null). This is the only decorator that ignores skipMissingProperties option.

Optional isEmail

isEmail: undefined | false | true

Checks if the string is an email.

Optional isFQDN

isFQDN: undefined | false | true

Checks if the string is a fully qualified domain name (e.g. domain.com).

Optional isIn

isIn: any[]

Checks if value is in a array of allowed values.

Optional isIp

isIp: undefined | string

Checks if the string is an IP address

Optional isIso8601

isIso8601: undefined | false | true

Checks if the string is a valid ISO 8601 date.

Optional isJson

isJson: undefined | false | true

Checks if the string is valid JSON.

Optional isLowercase

isLowercase: undefined | false | true

Checks if the string is lowercase.

Optional isMilitaryTime

isMilitaryTime: undefined | false | true

Checks if the string is a valid representation of military time in the format HH:MM.

Optional isMongoId

isMongoId: undefined | false | true

Checks if the string is a valid hex-encoded representation of a MongoDB ObjectId.

Optional isNotIn

isNotIn: any[]

Checks if value is not in a array of disallowed values.

Optional isNumberString

isNumberString: undefined | false | true

Checks if a string is a number.

Optional isOptional

isOptional: undefined | false | true

Checks if given value is empty (=== null, === undefined) and if so, ignores all the validators on the property.

Optional isUppercase

isUppercase: undefined | false | true

Checks if the string is uppercase.

Optional isUrl

isUrl: undefined | false | true

Checks if the string is an url.

Optional isUuid

isUuid: undefined | false | true

Checks if the string is a UUID (version 3, 4 or 5).

Optional matches

matches: RegExp

Regular Expression to validate against

Optional maxLength

maxLength: undefined | number

Maximum string length

Optional minLength

minLength: undefined | number

Minimum string length

name

name: string

The name of the symbol

Optional notContains

notContains: undefined | string

Checks if the string not contains the seed.

Optional notEmpty

notEmpty: any

Checks if given value is empty (=== '', === null, === undefined).

Optional notEquals

notEquals: any

Checks if value equals ("===") comparison.

Protected ownDecorator

ownDecorator: string = "IsString"

The prop instance's own type decorator

reportedType

reportedType: string

The type that was defined in the json/yaml

Protected sys

sys: LoDashStatic = sys

A local for templates to access lodash

Optional title

title: undefined | string

Short documentation

typeName

typeName: string = ""

The name typescript expects for the type

Accessors

prop

  • get prop(): string

Methods

Protected decs

  • decs(): string[]

headers

  • headers(): string[]

imports

  • imports(): string[]

renderDeclarations

  • renderDeclarations(): string[]

renderProp

  • renderProp(): string

validationImports

  • validationImports(): string[]

Object literals

Protected defaultTemplateOptions

defaultTemplateOptions: object

The default options for the template render

compileDebug

compileDebug: boolean = false

debug

debug: boolean = false

rmWhitespace

rmWhitespace: boolean = false

escape

  • escape(s: any): any

propToTemplate

propToTemplate: object

The map from property to template decorators of the class validator class

empty

empty: string = "IsEmpty"

equals

equals: string = "Equals"

isDefined

isDefined: string = "IsDefined"

isIn

isIn: string = "IsIn"

isNotIn

isNotIn: string = "IsNotIn"

notEmpty

notEmpty: string = "NotEmpty"

notEquals

notEquals: string = "NotEquals"

Generated using TypeDoc