Last active
June 15, 2020 21:01
-
-
Save thecotne/46656b2192cbaf307be8ea4950b85816 to your computer and use it in GitHub Desktop.
toUpperCase without fucking georgian text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toUpperCase (text) { | |
return Array.prototype.map.call(text, char => /[ა-ჰ]/.test(char) ? char : char.toUpperCase()).join('') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const toUpperCase = R.pipe( | |
R.map(R.ifElse(R.test(/[ა-ჰ]/), R.identity, R.toUpper)), | |
R.join('') | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment