Remove Spaces & Clear Stuff in Paragraphs

Mohammed Ahmed
1 min readFeb 27, 2021

Working on removing spaces was quite an interesting task. I’m still very new at JavaScript, so I thought that this would be a cool task to do!

So, I had to make a module and test module for removing spaces, easy, right? Kinda. It was really easy to make the module that removes the spaces, but making the test was a new task for me.

The test cases for Empty Paragraphs

This was me writing the tests. Dave made a really good point about using a node package called “clean-whitespace”, it removes quite literally anything that looks like a space. So, I implemented this, and then remove all the spaces right after as a means to sanitize. It worked on my machine, so I made a PR on it.

The code to clean the whitespace

So, now that I’ve got the code, and the test to work, it passed everything through our CI-CD’s and it got merged! Yay!

--

--

Mohammed Ahmed
0 Followers

Transit Enthusiast, and Games Enthusiast