From 414dd4680363dd1577ebf9733263c71402eae4e4 Mon Sep 17 00:00:00 2001 From: unwox Date: Tue, 15 Oct 2024 16:33:46 +0600 Subject: improve spellfix --- lib/string.fnl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/string.fnl') diff --git a/lib/string.fnl b/lib/string.fnl index ca29da0..1696a64 100644 --- a/lib/string.fnl +++ b/lib/string.fnl @@ -8,8 +8,8 @@ (= "string" (type str)) (string.format "letters(): str must be string, %s given" (type str))) (var result []) - (for [i 1 (must (luna.utf.len str))] - (table.insert result (must (luna.utf.sub str i 1)))) + (for [i 1 (must (luna.utf8.len str))] + (table.insert result (must (luna.utf8.sub str i 1)))) result) (fn split [str] @@ -27,9 +27,9 @@ (fn truncate [str len ellipsis] (if (and (= (type str) "string") (< 0 (# str))) - (if (< (must (luna.utf.len str)) len) + (if (< (must (luna.utf8.len str)) len) str - (.. (trim (must (luna.utf.sub str 1 len))) (or ellipsis "..."))) + (.. (trim (must (luna.utf8.sub str 1 len))) (or ellipsis "..."))) "")) {: letters : empty? : split : ends-with : trim : truncate} -- cgit v1.2.3