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)
5 Replies
ssalbdivad
ssalbdivad2w ago
string.numeric.parse
Bas950
Bas9502w ago
ty! Is there something like this for turning null into undefined? and the other way around?
ssalbdivad
ssalbdivad2w ago
No I' d probably just create your own scoped keyword for that
Bas950
Bas9502w ago
type('null').pipe(() => undefined) That should work right?
ssalbdivad
ssalbdivad2w ago
Yep!
Want results from more Discord servers?
Add your server