diff options
author | bptato <nincsnevem662@gmail.com> | 2023-08-28 22:33:31 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-08-28 22:38:00 +0200 |
commit | 1422f3393301cd6105b3939be194c7c119fcf967 (patch) | |
tree | 32969f2af8fe5293c13215a84229915a7970e828 /src/utils/twtstr.nim | |
parent | ba2a62f6d3a2879c9506ea3fb5aa5552fc4674d9 (diff) | |
download | chawan-1422f3393301cd6105b3939be194c7c119fcf967.tar.gz |
javascript: refactor
Split out parts of the JS module, because it was starting to confuse the compiler a little. (Peakmem is back at 750M. Interesting.)
Diffstat (limited to 'src/utils/twtstr.nim')
-rw-r--r-- | src/utils/twtstr.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim index 6f6c469d..d3cc8bd8 100644 --- a/src/utils/twtstr.nim +++ b/src/utils/twtstr.nim @@ -9,7 +9,7 @@ import options import bindings/libunicode import data/charwidth import data/idna -import js/javascript +import js/error import utils/map import utils/opt import lib/punycode @@ -1086,7 +1086,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): Result[bool, JSError] +type BoundaryFunction* = proc(x: Rune): JSResult[bool] proc breaksWord*(r: Rune, check: Opt[BoundaryFunction]): bool = if check.isSome: |