@bytesoftio/schema
Options
All
Public
Public/Protected
All
Inherited
Externals
Only exported
Menu
Array
Schema
Boolean
Schema
Date
Schema
Mixed
Schema
Number
Schema
constructor
conditional
Validation
Definitions
immutable
Mode
sanitizer
Definitions
validation
Definitions
add
Conditional
Validation
Definition
add
Sanitizer
Definition
add
Validation
Definition
also
and
between
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
integer
map
max
min
negative
optional
or
positive
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
Ceiled
to
Default
to
Floored
to
Rounded
to
Trunced
validate
validate
Async
validator
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
<
number
>
NumberSchema
Implements
ValidationSchema
<
number
>
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
between
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
integer
map
max
min
negative
optional
or
positive
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
Ceiled
to
Default
to
Floored
to
Rounded
to
Trunced
validate
validate
Async
validator
Constructors
constructor
new
Number
Schema
(
)
:
NumberSchema
Returns
NumberSchema
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
between
between
(
minValue
:
LazyValue
<
number
>
, maxValue
:
LazyValue
<
number
>
, message
?:
CustomValidationMessage
)
:
this
Parameters
minValue:
LazyValue
<
number
>
maxValue:
LazyValue
<
number
>
Optional
message:
CustomValidationMessage
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
<
number
>
, message
?:
CustomValidationMessage
)
:
this
Parameters
equal:
LazyValue
<
number
>
Optional
message:
CustomValidationMessage
Returns
this
integer
integer
(
message
?:
CustomValidationMessage
)
:
this
Parameters
Optional
message:
CustomValidationMessage
Returns
this
map
map
(
sanitizer
:
SanitizerFunction
)
:
this
Parameters
sanitizer:
SanitizerFunction
Returns
this
max
max
(
maxValue
:
LazyValue
<
number
>
, message
?:
CustomValidationMessage
)
:
this
Parameters
maxValue:
LazyValue
<
number
>
Optional
message:
CustomValidationMessage
Returns
this
min
min
(
minValue
:
LazyValue
<
number
>
, message
?:
CustomValidationMessage
)
:
this
Parameters
minValue:
LazyValue
<
number
>
Optional
message:
CustomValidationMessage
Returns
this
negative
negative
(
message
?:
CustomValidationMessage
)
:
this
Parameters
Optional
message:
CustomValidationMessage
Returns
this
optional
optional
(
message
?:
CustomValidationMessage
)
:
this
Parameters
Optional
message:
CustomValidationMessage
Returns
this
or
or
(
orValidator
:
CustomValidation
)
:
this
Parameters
orValidator:
CustomValidation
Returns
this
positive
positive
(
message
?:
CustomValidationMessage
)
:
this
Parameters
Optional
message:
CustomValidationMessage
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
Ceiled
to
Ceiled
(
)
:
this
Returns
this
to
Default
to
Default
(
defaultValue
?:
LazyValue
<
number
>
)
:
this
Parameters
Default value
defaultValue:
LazyValue
<
number
>
= 0
Returns
this
to
Floored
to
Floored
(
)
:
this
Returns
this
to
Rounded
to
Rounded
(
precision
?:
LazyValue
<
number
>
)
:
this
Parameters
Default value
precision:
LazyValue
<
number
>
= 0
Returns
this
to
Trunced
to
Trunced
(
)
:
this
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