This channel is just super fun! I’m super curious on how you come with these ideas though.
@Typed-Rocks19 сағат бұрын
Thank you 😁, I like to fiddle around with the more unusual parts of languages so as soon as you start to do that, the ideas will come naturally 🤘
@KamelJabber115 сағат бұрын
Fantastic content and we'll presented!
@Typed-Rocks14 сағат бұрын
Thank you 😁
@MrAlao6753 күн бұрын
you solve typescript types as if you don't know anything else... well done man.
@Typed-Rocks3 күн бұрын
Everyone needs a hobby 😝
@LePhenixGD3 күн бұрын
You never fail to amaze us ! This is wonderful !!!
@Typed-Rocks3 күн бұрын
Thank you so much for your kind words. Glad it is helpful ☺️🤘
@danko95bgd3 күн бұрын
Wow typescript is so cool and powerful. Maybe it can tell me if func could throw an error, oh wait.
@Typed-Rocks2 күн бұрын
While I see your point, many languages think checked exceptions were a mistake. Often they just get thrown further.
@gerkim622 күн бұрын
This is the biggest issue in typescript by far
@pierwszywolnynickКүн бұрын
every function can throw an error, a stack overflow or out of memory, checked exceptions are just irritating
@BeeBeeEight3 күн бұрын
Amazing work there. I remember u covered how to make sure rgb values has exactly 3 numbers with template literals. Now I feel like trying with this method to make sure those numbers are within range (0-255).
@Typed-Rocks3 күн бұрын
You could but it could make your types quite recursively deep and not that well readable. So always keep that in mind 🤘👍
@precisionchoker3 күн бұрын
Wow this is awesome Subscribed
@Typed-Rocks3 күн бұрын
Awesome, thank you!
@balaclava3512 күн бұрын
Can you explain how to limit a number to range. Currently if I want to restrict a number to be `
@djs-vidsКүн бұрын
hihi! How do you view the result of the type as a comment like that (3:04)? You were using a different IDE before but not it's finally VSCode I think. Great content btw!
@Typed-RocksКүн бұрын
Thank you 🤘. It‘s called „twoslash-queries“ for vscode and „witt“ for Jetbrains.
@dave60123 күн бұрын
I opening a PR with this type first thing monday morning
@Typed-Rocks3 күн бұрын
Keep me updated if they liked it 🤘😁
@moneyfr3 күн бұрын
you should work with valibot
@Typed-Rocks3 күн бұрын
I will look into it. Looks interesting 👍🤘
@snatvb3 күн бұрын
it would be great to have possibility to add own error messages :)
@Typed-Rocks2 күн бұрын
We could make it so that instead of never, it returns an object type with an error property in
@snatvb2 күн бұрын
@@Typed-Rocks but it's not an really error. I mean improvement TS compiler :) but it's just kinda my "ny wish" :D
@ИльяСтрелец-ц4к3 күн бұрын
Think it's better to take string's "length" property directly, as it is readonly despite arrays length property which can be set directly by programmer
@Typed-Rocks2 күн бұрын
In types you can‘t use the length property of the string as it‘s just „string“. That‘s why you need to do that trick.
@kettenbach8 сағат бұрын
@@Typed-Rocksthis gives compile time support also. String.length is runtime
@pierwszywolnynickКүн бұрын
very cool but as always - please don't actually use it, especially for comparing large numbers; you will kill the compiler and IDE performance quickly
@AbhiShake-pl3cf2 күн бұрын
Counter doesnt need to be an array. It should just be a readonly number
@Typed-Rocks2 күн бұрын
It cant, as we need to update the counter every recursive iteration. Otherwise we would need to create an array and increment it and put it back into a number each time.
@AbhiShake-pl3cf2 күн бұрын
Ah yes i just tried and i cant just increment numeric type. Sorry for saying that without confirming it. You are awesome
@Typed-Rocks2 күн бұрын
@ no worries. Thanks for your comment 😁
@jfftck6 сағат бұрын
Isn’t this getting outside the domain of types? I don’t understand why you would really want or need this, it is a lot of computation on something that should be a concrete type definition. This is bad practice for typing and I wouldn’t use this code in my code base, it’s also pointed out that runtime checks are necessary for any values that are not consistent.