util.jsonpointer: Silence Teal warning

It seems to think 'table' never has array items, but we don't know that.
This commit is contained in:
Kim Alvefur 2023-06-30 15:02:26 +02:00
parent f7323ed6e4
commit 70e4b13d0e

View file

@ -23,7 +23,7 @@ local function resolve_json_pointer(ref : table, path : string) : any, ptr_error
new_ref = ref[token] new_ref = ref[token]
elseif idx is integer then elseif idx is integer then
local i = tonumber(token) local i = tonumber(token)
if token == "-" then i = #ref + 1 end if token == "-" then i = #(ref as {any}) + 1 end
new_ref = ref[i+1] new_ref = ref[i+1]
else else
return nil, "invalid-table" return nil, "invalid-table"