I started with JS about 10 years ago and I fell in love with it (even though it can be weird 😅). I had step backs in my career that ended up being good. Currently I'm a passionate front-end developer.
Yeah, that is one of the main purposes of the library, actually one of the main features is that it can make debugging easier. For example:
import{typeErrorIf}from"typelib-js";functiongenerateFile(file){typeErrorIf(file).isNot("blob").throwIt();//alternatively you can catchIt() and store it in a variableconsole.log("File type is valid");}/* This would generate a TypeError because the function is
expecting a blob, not a string*/generateFile("My file content");
*You can test this if you go the page project, open your browser console and paste this code snippet (except for the import statement). You can also try to pass a blob to test it (new Blob(["My file content"])).
I think on Thursday I'll publish a post giving further details about this feature. Thanks for your feedback! 😉
I started with JS about 10 years ago and I fell in love with it (even though it can be weird 😅). I had step backs in my career that ended up being good. Currently I'm a passionate front-end developer.
Hey, thanks!
Yeah, that is one of the main purposes of the library, actually one of the main features is that it can make debugging easier. For example:
*You can test this if you go the page project, open your browser console and paste this code snippet (except for the import statement). You can also try to pass a blob to test it (
new Blob(["My file content"])).I think on Thursday I'll publish a post giving further details about this feature. Thanks for your feedback! 😉
Very cool, ran it through the console, throws the error, then I can handle it any way I want. Definitely let me know when the post is available!
Thanks! I just published it! link to the post