diff teal-src/prosody/util/datamapper.tl @ 13878:9ec961173b1c

teal: Remove trailing semicolons after return Apparently illegal syntax now, the nothing after the semicolon counts as a statement, which is not allowed after return?
author Kim Alvefur <zash@zash.se>
date Fri, 09 May 2025 00:30:32 +0200
parents fbbf4f0db8f0
children 88a5cb5a1ab5
line wrap: on
line diff
--- a/teal-src/prosody/util/datamapper.tl	Mon May 19 18:41:55 2025 +0200
+++ b/teal-src/prosody/util/datamapper.tl	Fri May 09 00:30:32 2025 +0200
@@ -42,7 +42,7 @@
 local function totype(t : json_type_name, s : string) : any
 	if not s then return nil end
 	if t == "string" then
-		return s;
+		return s
 	elseif t == "boolean" then
 		return toboolean(s)
 	elseif t == "number" or t == "integer" then
@@ -63,10 +63,10 @@
 local function resolve_schema(schema  : schema_t, root : json_schema_object) : schema_t
 	if schema is json_schema_object then
 		if schema["$ref"] and schema["$ref"]:sub(1, 1) == "#" then
-			return pointer.resolve(root as table, schema["$ref"]:sub(2)) as schema_t;
+			return pointer.resolve(root as table, schema["$ref"]:sub(2)) as schema_t
 		end
 	end
-	return schema;
+	return schema
 end
 
 local function guess_schema_type(schema : json_schema_object) : json_type_name
@@ -158,7 +158,7 @@
 			c = s:get_child(nil, namespace);
 		end
 		if c then
-			return c.name;
+			return c.name
 		end
 	elseif value_where == "in_attribute" then
 		local attr = name
@@ -250,7 +250,7 @@
 			table.insert(out, totype(proptype, value));
 		end
 	end
-	return out;
+	return out
 end
 
 local function parse (schema : json_schema_object, s : st.stanza_t) : table
@@ -361,7 +361,7 @@
 				unparse_property(out, v, proptype, propschema, value_where, name, namespace, current_ns, prefix, single_attribute, root)
 			end
 		end
-		return out;
+		return out
 
 	elseif s_type == "array" then
 		local itemschema = resolve_schema(schema.items, root)
@@ -369,7 +369,7 @@
 		for _, item in ipairs(t as { string }) do
 			unparse_property(out, item, proptype, itemschema, value_where, name, namespace, current_ns, prefix, single_attribute, root)
 		end
-		return out;
+		return out
 	end
 end