VitorLuizC/brazilian-values

formatToCapitalized don't allow space-key?

guitexa opened this issue · 3 comments

It's me again 😁

I'm trying to use formatToCapitalized function, but it's impossible to type space-key as you can see in this example on SandBox below:

https://codesandbox.io/s/keen-bose-k6y63

Thanks for helping 🙏🏼

Hmmm, i'm currently using String.prototype.trim to prevent trailling whitespaces. So, no it don't.

I'll add an option to disable this behavior

Fixed and published under version 0.8.0.

Now you can disable trim trailing white-spaces with trimTrailingWhiteSpaces: false.

formatToCapitalized(' com espaços antes e depois ', {
  trimTrailingWhiteSpaces: false
})
//=> ' Com Espaços Antes e Depois '

Show man, it's worked fine, thanks! 🙏🏼