Mercurial > prosody-hg
diff util/jsonpointer.lua @ 12781:22066b02887f
util.startup: Provide a common Lua 5.3+ math.type() for Lua 5.2
Code deduplication
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 19 Oct 2022 16:25:05 +0200 |
| parents | 03e307952816 |
| children | b713da7527d2 |
line wrap: on
line diff
--- a/util/jsonpointer.lua Thu Oct 20 16:56:45 2022 +0200 +++ b/util/jsonpointer.lua Wed Oct 19 16:25:05 2022 +0200 @@ -1,6 +1,4 @@ -local m_type = math.type or function (n) - return n % 1 == 0 and n <= 9007199254740992 and n >= -9007199254740992 and "integer" or "float"; -end; +local m_type = math.type; local function unescape_token(escaped_token) local unescaped = escaped_token:gsub("~1", "/"):gsub("~0", "~")
