diff options
author | Kim Alvefur <zash@zash.se> | 2023-06-30 15:02:26 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-06-30 15:02:26 +0200 |
commit | 70e4b13d0e8eab8cf058c2db5750ee9bd5dababf (patch) | |
tree | 3a81a408dca4ee70ee266d48fb338ed4c67b16c7 /teal-src/prosody | |
parent | f7323ed6e45a8354a88928cbf91c73c7078cd2d0 (diff) | |
download | prosody-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/prosody')
-rw-r--r-- | teal-src/prosody/util/jsonpointer.tl | 2 |
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" |