aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--teal-src/prosody/util/jsonschema.tl4
-rw-r--r--util/jsonschema.lua4
2 files changed, 4 insertions, 4 deletions
diff --git a/teal-src/prosody/util/jsonschema.tl b/teal-src/prosody/util/jsonschema.tl
index 0971c548..5a1b0e92 100644
--- a/teal-src/prosody/util/jsonschema.tl
+++ b/teal-src/prosody/util/jsonschema.tl
@@ -11,8 +11,8 @@
if not math.type then require "prosody.util.mathcompat" end
-local utf8 = rawget(_G, "utf8") or require"prosody.util.encodings".utf8;
-local utf8_len = utf8.len or function(s)
+local utf8_enc = rawget(_G, "utf8") or require"prosody.util.encodings".utf8;
+local utf8_len = utf8_enc.len or function(s : string) : integer
local _, count = s:gsub("[%z\001-\127\194-\253][\128-\191]*", "");
return count;
end;
diff --git a/util/jsonschema.lua b/util/jsonschema.lua
index 316fe976..96d6547d 100644
--- a/util/jsonschema.lua
+++ b/util/jsonschema.lua
@@ -4,8 +4,8 @@ local m_type = function(n)
return type(n) == "number" and n % 1 == 0 and n <= 9007199254740992 and n >= -9007199254740992 and "integer" or "float";
end;
-local utf8 = rawget(_G, "utf8") or require("prosody.util.encodings").utf8;
-local utf8_len = utf8.len or function(s)
+local utf8_enc = rawget(_G, "utf8") or require("prosody.util.encodings").utf8;
+local utf8_len = utf8_enc.len or function(s)
local _, count = s:gsub("[%z\001-\127\194-\253][\128-\191]*", "");
return count
end;