UNPKG

@dan-sogbey/whitespaceremover

Version:

A short function to remove white spaces in a string

11 lines (9 loc) 270 B
const whiteSpaceRemover = (string) => { if (typeof string !== "string") { throw new TypeError("A string must be supplied as an argument") } else { const output = string.replace(/\s/g, "") return output } } module.exports = whiteSpaceRemover