aboutsummaryrefslogtreecommitdiffstats
path: root/teal-src
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-06-30 15:02:26 +0200
committerKim Alvefur <zash@zash.se>2023-06-30 15:02:26 +0200
commit70e4b13d0e8eab8cf058c2db5750ee9bd5dababf (patch)
tree3a81a408dca4ee70ee266d48fb338ed4c67b16c7 /teal-src
parentf7323ed6e45a8354a88928cbf91c73c7078cd2d0 (diff)
downloadprosody-70e4b13d0e8eab8cf058c2db5750ee9bd5dababf.tar.gz
prosody-70e4b13d0e8eab8cf058c2db5750ee9bd5dababf.zip
util.jsonpointer: Silence Teal warning
It seems to think 'table' never has array items, but we don't know that.
Diffstat (limited to 'teal-src')
-rw-r--r--teal-src/prosody/util/jsonpointer.tl2
1 files changed, 1 insertions, 1 deletions
diff --git a/teal-src/prosody/util/jsonpointer.tl b/teal-src/prosody/util/jsonpointer.tl
index c21e1fbf..af29bda0 100644
--- a/teal-src/prosody/util/jsonpointer.tl
+++ b/teal-src/prosody/util/jsonpointer.tl
@@ -23,7 +23,7 @@ local function resolve_json_pointer(ref : table, path : string) : any, ptr_error
new_ref = ref[token]
elseif idx is integer then
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]
else
return nil, "invalid-table"