DEV Community

Mark Matthew Vergara
Mark Matthew Vergara

Posted on

"Utils.ts" Security?

Up until now I always put my client side and server side utils on the same file

1st Method

Enter fullscreen mode Exit fullscreen mode

2nd Method
but maybe this approach is better and more secure

Enter fullscreen mode Exit fullscreen mode

This method makes it clearer which code is intended to run on the client side and which code is designed to run on the server side, which can help you manage and comprehend your codebase more easily.


Let's assume we are doing named imports
Is using 1st method can expose some server side utils in the client side?

Latest comments (0)