From f0242ae57c14ed1417a80e475784aaaded04dfe4 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 17 Jun 2023 17:17:44 +0200 Subject: util.jsonschema: Silence Teal warnings about utf8 library Teal worries that we redefine the global. Also that the fallback was missing type information. --- util/jsonschema.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util') 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; -- cgit v1.2.3