@bytesoftio/schema
Options
All
Public
Public/Protected
All
Inherited
Externals
Only exported
Menu
Array
Schema
Boolean
Schema
constructor
conditional
Validation
Definitions
immutable
Mode
sanitizer
Definitions
validation
Definitions
add
Conditional
Validation
Definition
add
Sanitizer
Definition
add
Validation
Definition
also
and
clone
clone
Instance
custom
Sanitize
Behavior
custom
Sanitize
Behavior
Async
custom
Testing
Behavior
custom
Testing
Behavior
Async
custom
Validation
Behavior
custom
Validation
Behavior
Async
equals
map
optional
or
remove
Validation
Definitions
OfType
required
sanitize
sanitize
And
Test
sanitize
And
Test
Async
sanitize
And
Validate
sanitize
And
Validate
Async
sanitize
Async
sanitizer
skip
Clone
test
test
Async
to
Default
validate
validate
Async
validator
Date
Schema
Mixed
Schema
Number
Schema
Object
Schema
Schema
String
Schema
Validation
Schema
Custom
Validation
Custom
Validation
Message
Custom
Validation
Result
Lazy
Value
Maybe
Promise
Object
Shape
Sanitizer
Definition
Sanitizer
Function
Validation
Block
Validation
Definition
Validation
Error
Validation
Function
Validation
Function
Result
Validation
Link
Validation
Path
Validation
Result
Validation
Type
schema
Translator
array
boolean
create
Validation
Result
date
mixed
number
object
string
value
Hierarchy
Schema
<
boolean
>
BooleanSchema
Implements
ValidationSchema
<
boolean
>
Index
Constructors
constructor
Properties
conditional
Validation
Definitions
immutable
Mode
sanitizer
Definitions
validation
Definitions
Methods
add
Conditional
Validation
Definition
add
Sanitizer
Definition
add
Validation
Definition
also
and
clone
clone
Instance
custom
Sanitize
Behavior
custom
Sanitize
Behavior
Async
custom
Testing
Behavior
custom
Testing
Behavior
Async
custom
Validation
Behavior
custom
Validation
Behavior
Async
equals
map
optional
or
remove
Validation
Definitions
OfType
required
sanitize
sanitize
And
Test
sanitize
And
Test
Async
sanitize
And
Validate
sanitize
And
Validate
Async
sanitize
Async
sanitizer
skip
Clone
test
test
Async
to
Default
validate
validate
Async
validator
Constructors
constructor
new
Boolean
Schema
(
)
:
BooleanSchema
Returns
BooleanSchema
Properties
Protected
conditional
Validation
Definitions
conditional
Validation
Definitions
:
ValidationDefinition
[]
= []
Protected
immutable
Mode
immutable
Mode
:
boolean
= true
Protected
sanitizer
Definitions
sanitizer
Definitions
:
SanitizerDefinition
[]
= []
Protected
validation
Definitions
validation
Definitions
:
ValidationDefinition
[]
= []
Methods
Protected
add
Conditional
Validation
Definition
add
Conditional
Validation
Definition
(
validationDefinition
:
ValidationDefinition
)
:
this
Parameters
validationDefinition:
ValidationDefinition
Returns
this
Protected
add
Sanitizer
Definition
add
Sanitizer
Definition
(
sanitizerDefinition
:
SanitizerDefinition
)
:
this
Parameters
sanitizerDefinition:
SanitizerDefinition
Returns
this
Protected
add
Validation
Definition
add
Validation
Definition
(
validationDefinition
:
ValidationDefinition
)
:
this
Parameters
validationDefinition:
ValidationDefinition
Returns
this
also
also
(
validator
:
CustomValidation
)
:
this
Parameters
validator:
CustomValidation
Returns
this
and
and
(
andValidator
:
CustomValidation
)
:
this
Parameters
andValidator:
CustomValidation
Returns
this
Protected
clone
clone
(
)
:
this
Returns
this
Protected
clone
Instance
clone
Instance
(
)
:
this
Returns
this
Protected
custom
Sanitize
Behavior
custom
Sanitize
Behavior<TValue, TSanitizedValue>
(
value
:
TValue
)
:
TSanitizedValue
Type parameters
TValue
TSanitizedValue
Parameters
value:
TValue
Returns
TSanitizedValue
Protected
custom
Sanitize
Behavior
Async
custom
Sanitize
Behavior
Async<TValue, TSanitizedValue>
(
value
:
TValue
)
:
Promise
<
TSanitizedValue
>
Type parameters
TValue
TSanitizedValue
Parameters
value:
TValue
Returns
Promise
<
TSanitizedValue
>
Protected
custom
Testing
Behavior
custom
Testing
Behavior
(
value
:
any
, testResult
:
boolean
)
:
boolean
Parameters
value:
any
testResult:
boolean
Returns
boolean
Protected
custom
Testing
Behavior
Async
custom
Testing
Behavior
Async
(
value
:
any
, testResult
:
boolean
)
:
Promise
<
boolean
>
Parameters
value:
any
testResult:
boolean
Returns
Promise
<
boolean
>
Protected
custom
Validation
Behavior
custom
Validation
Behavior
(
value
:
any
, errors
:
ValidationError
[]
)
:
ValidationError
[]
Parameters
value:
any
errors:
ValidationError
[]
Returns
ValidationError
[]
Protected
custom
Validation
Behavior
Async
custom
Validation
Behavior
Async
(
value
:
any
, errors
:
ValidationError
[]
)
:
Promise
<
ValidationError
[]
>
Parameters
value:
any
errors:
ValidationError
[]
Returns
Promise
<
ValidationError
[]
>
equals
equals
(
equal
:
LazyValue
<
boolean
>
, message
?:
CustomValidationMessage
)
:
this
Parameters
equal:
LazyValue
<
boolean
>
Optional
message:
CustomValidationMessage
Returns
this
map
map
(
sanitizer
:
SanitizerFunction
)
:
this
Parameters
sanitizer:
SanitizerFunction
Returns
this
optional
optional
(
message
?:
CustomValidationMessage
)
:
this
Parameters
Optional
message:
CustomValidationMessage
Returns
this
or
or
(
orValidator
:
CustomValidation
)
:
this
Parameters
orValidator:
CustomValidation
Returns
this
Protected
remove
Validation
Definitions
OfType
remove
Validation
Definitions
OfType
(
type
:
ValidationType
)
:
this
Parameters
type:
ValidationType
Returns
this
required
required
(
required
?:
LazyValue
<
boolean
>
, message
?:
CustomValidationMessage
)
:
this
Parameters
Optional
required:
LazyValue
<
boolean
>
Optional
message:
CustomValidationMessage
Returns
this
sanitize
sanitize<TValue, TSanitizedValue>
(
value
:
TValue
)
:
TSanitizedValue
Type parameters
TValue
TSanitizedValue
Parameters
value:
TValue
Returns
TSanitizedValue
sanitize
And
Test
sanitize
And
Test<TValue, TSanitizedValue>
(
value
:
any
)
:
[
boolean
,
TSanitizedValue
]
Type parameters
TValue
TSanitizedValue
Parameters
value:
any
Returns
[
boolean
,
TSanitizedValue
]
sanitize
And
Test
Async
sanitize
And
Test
Async<TValue, TSanitizedValue>
(
value
:
any
)
:
Promise
<
[
boolean
,
TSanitizedValue
]
>
Type parameters
TValue
TSanitizedValue
Parameters
value:
any
Returns
Promise
<
[
boolean
,
TSanitizedValue
]
>
sanitize
And
Validate
sanitize
And
Validate<TValue, TSanitizedValue>
(
value
:
any
)
:
[
ValidationError
[]
|
undefined
,
TSanitizedValue
]
Type parameters
TValue
TSanitizedValue
Parameters
value:
any
Returns
[
ValidationError
[]
|
undefined
,
TSanitizedValue
]
sanitize
And
Validate
Async
sanitize
And
Validate
Async<TValue, TSanitizedValue>
(
value
:
any
)
:
Promise
<
[
ValidationError
[]
|
undefined
,
TSanitizedValue
]
>
Type parameters
TValue
TSanitizedValue
Parameters
value:
any
Returns
Promise
<
[
ValidationError
[]
|
undefined
,
TSanitizedValue
]
>
sanitize
Async
sanitize
Async<TValue, TSanitizedValue>
(
value
:
TValue
)
:
Promise
<
TSanitizedValue
>
Type parameters
TValue
TSanitizedValue
Parameters
value:
TValue
Returns
Promise
<
TSanitizedValue
>
sanitizer
sanitizer
(
sanitizer
:
SanitizerFunction
)
:
this
Parameters
sanitizer:
SanitizerFunction
Returns
this
Protected
skip
Clone
skip
Clone
(
fn
:
(
)
=>
void
)
:
void
Parameters
fn:
(
)
=>
void
(
)
:
void
Returns
void
Returns
void
test
test
(
value
:
any
)
:
boolean
Parameters
value:
any
Returns
boolean
test
Async
test
Async
(
value
:
any
)
:
Promise
<
boolean
>
Parameters
value:
any
Returns
Promise
<
boolean
>
to
Default
to
Default
(
defaultValue
?:
LazyValue
<
boolean
>
)
:
this
Parameters
Default value
defaultValue:
LazyValue
<
boolean
>
= false
Returns
this
validate
validate
(
value
:
any
)
:
ValidationError
[]
|
undefined
Parameters
value:
any
Returns
ValidationError
[]
|
undefined
validate
Async
validate
Async
(
value
:
any
)
:
Promise
<
ValidationError
[]
|
undefined
>
Parameters
value:
any
Returns
Promise
<
ValidationError
[]
|
undefined
>
validator
validator
(
validator
:
CustomValidation
)
:
this
Parameters
validator:
CustomValidation
Returns
this