about summary refs log tree commit diff stats
path: root/src/utils/twtstr.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-07-03 18:00:29 +0200
committerbptato <nincsnevem662@gmail.com>2023-07-03 18:00:29 +0200
commit6372f3bd156bd24e53ae418bfc04ffceb45139f1 (patch)
tree219045e87b8e264392e085c69862b359fa176e3c /src/utils/twtstr.nim
parent307003b8043998283ea0d7a64bcd5f8c2c3f554d (diff)
downloadchawan-6372f3bd156bd24e53ae418bfc04ffceb45139f1.tar.gz
Fix JS type conversion regressions
Diffstat (limited to 'src/utils/twtstr.nim')
-rw-r--r--src/utils/twtstr.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim
index c7ba2db6..f735252c 100644
--- a/src/utils/twtstr.nim
+++ b/src/utils/twtstr.nim
@@ -8,10 +8,11 @@ import options
 import punycode
 
 import bindings/libunicode
-import data/idna
 import data/charwidth
-import utils/opt
+import data/idna
+import js/javascript
 import utils/map
+import utils/opt
 
 when defined(posix):
   import posix
@@ -1074,7 +1075,7 @@ func twidth*(s: string, w: int): int =
 func breaksWord*(r: Rune): bool =
   return not (r.isDigitAscii() or r.width() == 0 or r.isAlpha())
 
-type BoundaryFunction* = proc(x: Rune): Opt[bool]
+type BoundaryFunction* = proc(x: Rune): Result[bool, JSError]
 
 proc breaksWord*(r: Rune, check: Opt[BoundaryFunction]): bool =
   if check.isSome: