UNPKG
@nkravella/tinytest
Version:
latest (2.0.0)
2.0.0
1.0.0
Removes all spaces from a string
github.com/nkravella/tinytest
nkravella/tinytest
@nkravella/tinytest
/
index.js
8 lines
(7 loc)
•
215 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
module
.
exports
=
function
tiny
(
string
) {
// Function to remove all spaces from string.
if
(
typeof
string
!==
"string"
)
throw
new
TypeError
(
"Only strings allowed here!"
);
return
string
.
replace
(
/\s/g
,
""
); };