From 31a2cb52b0b4dbaa3f5bd17de18aabe40fa37e93 Mon Sep 17 00:00:00 2001 From: V1K1NGbg Date: Sun, 4 Aug 2024 16:53:33 +0300 Subject: type_check --- src/luarocks/type_check.lua | 12 ++++++------ src/luarocks/type_check.tl | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/luarocks/type_check.lua b/src/luarocks/type_check.lua index 50eceddf..77f9ef24 100644 --- a/src/luarocks/type_check.lua +++ b/src/luarocks/type_check.lua @@ -31,9 +31,9 @@ type_check.MAGIC_PLATFORMS = {} do local function fill_in_version(tbl, version) - - - + if not tbl.fields then + return + end for _, v in pairs(tbl.fields) do if type(v) == "table" then @@ -191,10 +191,10 @@ function type_check.type_check_table(version, tbl, typetbl, context) return nil, errcheck end + if not typetbl.fields then - - - + return true + end for k, v in pairs(tbl) do local t = typetbl.fields[tostring(k)] or typetbl._any diff --git a/src/luarocks/type_check.tl b/src/luarocks/type_check.tl index 6b5dbb16..7c3c4064 100644 --- a/src/luarocks/type_check.tl +++ b/src/luarocks/type_check.tl @@ -31,9 +31,9 @@ type_check.MAGIC_PLATFORMS = {} do local function fill_in_version(tbl: TableSchema, version?: string) - -- if not tbl.fields then --! validation - -- return - -- end + if not tbl.fields then --! validation + return + end for _, v in pairs(tbl.fields) do if v is TableSchema then @@ -191,10 +191,10 @@ function type_check.type_check_table(version: string, tbl: {any: any}, typetbl: return nil, errcheck end - -- if not typetbl.fields then --! validation - -- -- if there are no fields, exit the checker - -- return true - -- end + if not typetbl.fields then --! validation + -- if there are no fields, exit the checker + return true + end for k, v in pairs(tbl) do local t = typetbl.fields[tostring(k)] or typetbl._any --! tostring -- cgit v1.2.3-55-g6feb