Type Utils
Preparing search index...
optional
Function optional
optional
()
:
{
any
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
any
>
>
;
asNull
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
null
>
>
;
asUndefined
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
undefined
>
>
;
boolean
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
boolean
>
>
;
primitive
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
PrimitiveType
>
>
;
symbol
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
symbol
>
>
;
and
<
T1
,
T2
>
(
guard1
:
TypeGuard
<
T1
>
,
guard2
:
TypeGuard
<
T2
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Merge
<
T1
,
T2
>
>
>
;
and
<
TGuards
extends
TypeGuards
<
any
>
>
(
...
guards
:
TGuards
,
)
:
TypeGuard
<
TIntersection
<
GetTypeGuards
<
TGuards
>
>
>
;
array
()
:
OptionalizeTypeGuard
<
TypeGuard
<
any
[]
>
>
;
array
(
rules
:
ArrayRules
[]
)
:
OptionalizeTypeGuard
<
TypeGuard
<
any
[]
>
>
;
array
<
T
>
(
rules
:
ArrayRules
[]
,
schema
:
TypeGuard
<
T
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
[]
>
>
;
array
<
T
>
(
schema
:
TypeGuard
<
T
>
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
[]
>
>
;
asEnum
<
T
extends
PrimitiveType
>
(
values
:
T
[]
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
>
>
;
bigint
()
:
TypeGuard
<
bigint
>
;
bigint
(
rules
:
Partial
<
BigIntRulesConfig
>
)
:
TypeGuard
<
bigint
>
;
bigint
(
rules
:
NumberRules
[]
)
:
TypeGuard
<
bigint
>
;
number
()
:
TypeGuard
<
number
>
;
number
(
rules
:
Partial
<
NumberRulesConfig
>
)
:
TypeGuard
<
number
>
;
number
(
rules
:
NumberRules
[]
)
:
TypeGuard
<
number
>
;
object
<
T
extends
{}
>
(
tree
:
ValidatorMap
<
T
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Sanitize
<
T
>
>
>
;
object
()
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
any
,
any
>
>
>
;
object
(
tree
:
{}
)
:
OptionalizeTypeGuard
<
TypeGuard
<
{}
>
>
;
or
<
T1
,
T2
>
(
guard1
:
TypeGuard
<
T1
>
,
guard2
:
TypeGuard
<
T2
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T1
|
T2
>
>
;
or
<
TGuards
extends
TypeGuards
<
any
>
>
(
...
guards
:
TGuards
,
)
:
TypeGuard
<
TUnion
<
GetTypeGuards
<
TGuards
>
>
>
;
record
()
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
string
,
any
>
>
>
;
record
(
rules
:
RecordRules
[]
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
string
,
any
>
>
>
;
record
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
K
,
T
>
>
>
;
record
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
rules
:
RecordRules
[]
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
K
,
T
>
>
>
;
string
()
:
OptionalizeTypeGuard
<
TypeGuard
<
string
>
>
;
string
(
rules
:
StringRules
[]
)
:
OptionalizeTypeGuard
<
TypeGuard
<
string
>
>
;
string
<
T
extends
string
>
(
matches
:
T
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
>
>
;
string
(
regex
:
RegExp
)
:
OptionalizeTypeGuard
<
TypeGuard
<
string
>
>
;
useSchema
<
T
>
(
schema
:
TypeGuard
<
T
>
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
>
>
;
}
Returns
{
any
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
any
>
>
;
asNull
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
null
>
>
;
asUndefined
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
undefined
>
>
;
boolean
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
boolean
>
>
;
primitive
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
PrimitiveType
>
>
;
symbol
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
symbol
>
>
;
and
<
T1
,
T2
>
(
guard1
:
TypeGuard
<
T1
>
,
guard2
:
TypeGuard
<
T2
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Merge
<
T1
,
T2
>
>
>
;
and
<
TGuards
extends
TypeGuards
<
any
>
>
(
...
guards
:
TGuards
,
)
:
TypeGuard
<
TIntersection
<
GetTypeGuards
<
TGuards
>
>
>
;
array
()
:
OptionalizeTypeGuard
<
TypeGuard
<
any
[]
>
>
;
array
(
rules
:
ArrayRules
[]
)
:
OptionalizeTypeGuard
<
TypeGuard
<
any
[]
>
>
;
array
<
T
>
(
rules
:
ArrayRules
[]
,
schema
:
TypeGuard
<
T
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
[]
>
>
;
array
<
T
>
(
schema
:
TypeGuard
<
T
>
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
[]
>
>
;
asEnum
<
T
extends
PrimitiveType
>
(
values
:
T
[]
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
>
>
;
bigint
()
:
TypeGuard
<
bigint
>
;
bigint
(
rules
:
Partial
<
BigIntRulesConfig
>
)
:
TypeGuard
<
bigint
>
;
bigint
(
rules
:
NumberRules
[]
)
:
TypeGuard
<
bigint
>
;
number
()
:
TypeGuard
<
number
>
;
number
(
rules
:
Partial
<
NumberRulesConfig
>
)
:
TypeGuard
<
number
>
;
number
(
rules
:
NumberRules
[]
)
:
TypeGuard
<
number
>
;
object
<
T
extends
{}
>
(
tree
:
ValidatorMap
<
T
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Sanitize
<
T
>
>
>
;
object
()
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
any
,
any
>
>
>
;
object
(
tree
:
{}
)
:
OptionalizeTypeGuard
<
TypeGuard
<
{}
>
>
;
or
<
T1
,
T2
>
(
guard1
:
TypeGuard
<
T1
>
,
guard2
:
TypeGuard
<
T2
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T1
|
T2
>
>
;
or
<
TGuards
extends
TypeGuards
<
any
>
>
(
...
guards
:
TGuards
,
)
:
TypeGuard
<
TUnion
<
GetTypeGuards
<
TGuards
>
>
>
;
record
()
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
string
,
any
>
>
>
;
record
(
rules
:
RecordRules
[]
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
string
,
any
>
>
>
;
record
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
K
,
T
>
>
>
;
record
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
rules
:
RecordRules
[]
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
K
,
T
>
>
>
;
string
()
:
OptionalizeTypeGuard
<
TypeGuard
<
string
>
>
;
string
(
rules
:
StringRules
[]
)
:
OptionalizeTypeGuard
<
TypeGuard
<
string
>
>
;
string
<
T
extends
string
>
(
matches
:
T
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
>
>
;
string
(
regex
:
RegExp
)
:
OptionalizeTypeGuard
<
TypeGuard
<
string
>
>
;
useSchema
<
T
>
(
schema
:
TypeGuard
<
T
>
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
>
>
;
}
Settings
Member Visibility
Inherited
External
Theme
OS
Light
Dark
Type Utils
Loading...