about summary refs log tree commit diff stats
path: root/src/utils/twtstr.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-02-27 18:45:17 +0100
committerbptato <nincsnevem662@gmail.com>2024-02-27 18:45:17 +0100
commit0f2c08006a8787fc1a8a67ecf125fdffadd245ff (patch)
tree77db5c898bf8f55835466efa175342fa42a32f01 /src/utils/twtstr.nim
parent5c978a3441cec24f2ffbd11b6e6bb3e2f429aadf (diff)
downloadchawan-0f2c08006a8787fc1a8a67ecf125fdffadd245ff.tar.gz
misc refactorings
* rename buffer enums
* fix isAscii for char 0x80
* remove dead code from URL
Diffstat (limited to 'src/utils/twtstr.nim')
-rw-r--r--src/utils/twtstr.nim14
1 files changed, 1 insertions, 13 deletions
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