Software /
code /
prosody
Comparison
util/format.lua @ 12590:5eaf77114fdb
compat: Use table.pack (there since Lua 5.2) over our util.table
Added in d278a770eddc avoid having to deal with its absence in Lua 5.1.
No longer needed when Lua 5.1 support is dropped.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 11 Jul 2022 19:15:24 +0200 (2022-07-11) |
parent | 12589:39ae08180c81 |
child | 12781:22066b02887f |
comparison
equal
deleted
inserted
replaced
12589:39ae08180c81 | 12590:5eaf77114fdb |
---|---|
5 -- | 5 -- |
6 -- Provides some protection from e.g. CAPEC-135, CWE-117, CWE-134, CWE-93 | 6 -- Provides some protection from e.g. CAPEC-135, CWE-117, CWE-134, CWE-93 |
7 | 7 |
8 local tostring = tostring; | 8 local tostring = tostring; |
9 local unpack = table.unpack; | 9 local unpack = table.unpack; |
10 local pack = require "util.table".pack; -- TODO table.pack in 5.2+ | 10 local pack = table.pack; |
11 local valid_utf8 = require "util.encodings".utf8.valid; | 11 local valid_utf8 = require "util.encodings".utf8.valid; |
12 local type = type; | 12 local type = type; |
13 local dump = require "util.serialization".new("debug"); | 13 local dump = require "util.serialization".new("debug"); |
14 local num_type = math.type or function (n) | 14 local num_type = math.type or function (n) |
15 return n % 1 == 0 and n <= 9007199254740992 and n >= -9007199254740992 and "integer" or "float"; | 15 return n % 1 == 0 and n <= 9007199254740992 and n >= -9007199254740992 and "integer" or "float"; |