Search
Get Started
a
arktype
•
16mo ago
Bas950
string input, number output
is there something like
const input = '600'; const out = type('parse.number')(input) console.log(out) // 600 (number)
const input = '600'; const out = type('parse.number')(input) console.log(out) // 600 (number)
arktype
Join
This is a friendly space centered around ArkType, TypeScript's 1:1 validator (https://github.com/arktypeio/arktype)
855
Members
View on Discord
Similar Threads
Was this page helpful?
Yes
No
const
input
=
'600'
;
const
out
=
type
(
'parse.number'
)(input)
console.
log
(out)
// 600 (number)
const
input
=
'600'
;
const
out
=
type
(
'parse.number'
)(input)
console.
log
(out)
// 600 (number)
Similar Threads
Empty string or number
a
arktype / questions
9mo ago
Accept number in string type
a
arktype / questions
17mo ago
Convert string to number with constraints
a
arktype / questions
17mo ago