Simply change the regex to exclude the apostrophes.
.replace(/[^a-zA-Z0-9]+(.)?/g, (_, char) => (char ? char.toUpperCase() : "")) // Remove non-alphanumerics and capitalize next character.