From 0f2c08006a8787fc1a8a67ecf125fdffadd245ff Mon Sep 17 00:00:00 2001 From: bptato Date: Tue, 27 Feb 2024 18:45:17 +0100 Subject: misc refactorings * rename buffer enums * fix isAscii for char 0x80 * remove dead code from URL --- src/utils/twtstr.nim | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/utils/twtstr.nim') diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim index 1916fff5..765ec24a 100644 --- a/src/utils/twtstr.nim +++ b/src/utils/twtstr.nim @@ -61,15 +61,6 @@ func toHeaderCase*(str: string): string = c = c.toUpperAscii() flip = c == '-' -func toScreamingSnakeCase*(str: string): string = # input is camel case - if str.len >= 1: result &= str[0].toUpperAscii() - for c in str.toOpenArray(1, str.high): - if c in AsciiUpperAlpha: - result &= '_' - result &= c - else: - result &= c.toUpperAscii() - func snakeToKebabCase*(str: string): string = result = str for c in result.mitems: @@ -93,9 +84,6 @@ func camelToKebabCase*(s: string): string = else: result &= c -func isAscii*(r: Rune): bool = - return uint32(r) < 128 - func startsWithNoCase*(str, prefix: string): bool = if str.len < prefix.len: return false # prefix.len is always lower @@ -129,7 +117,7 @@ func decValue*(c: char): int = func isAscii*(s: string): bool = for c in s: - if c > char(0x80): + if c >= char(0x80): return false return true -- cgit 1.4.1-2-gfad0