fix snakecase special case when acronym is pluralized
Created by: Strum355
Fixes error where e.g. uploadIDsWithReferences
-> upload_i_ds_with_references
. We special case cases of Is
e.g. HTTPIsEnabled
-> http_is_enabled
.
The check (!isLastCapital || next != 's')
in English says:
"given the current letter is a capital letter:"
- if the prev letter wasnt a capital letter, add
_
(e.g. testEnabled) - else if the prev letter was a capital letter and the next one isnt an
s
(in the case of HTTPRe and not in the case of IDs), also add_
so that HTTPRe -> http_re