comparison util/json.lua @ 12975:d10957394a3c

util: Prefix module imports with prosody namespace
author Kim Alvefur <zash@zash.se>
date Fri, 17 Mar 2023 16:23:16 +0100
parents 997f3ca90628
children
comparison
equal deleted inserted replaced
12974:ba409c67353b 12975:d10957394a3c
8 8
9 local type = type; 9 local type = type;
10 local t_insert, t_concat, t_remove = table.insert, table.concat, table.remove; 10 local t_insert, t_concat, t_remove = table.insert, table.concat, table.remove;
11 local s_char = string.char; 11 local s_char = string.char;
12 local tostring, tonumber = tostring, tonumber; 12 local tostring, tonumber = tostring, tonumber;
13 local pairs, ipairs, spairs = pairs, ipairs, require "util.iterators".sorted_pairs; 13 local pairs, ipairs, spairs = pairs, ipairs, require "prosody.util.iterators".sorted_pairs;
14 local next = next; 14 local next = next;
15 local getmetatable, setmetatable = getmetatable, setmetatable; 15 local getmetatable, setmetatable = getmetatable, setmetatable;
16 local print = print; 16 local print = print;
17 17
18 local has_array, array = pcall(require, "util.array"); 18 local has_array, array = pcall(require, "prosody.util.array");
19 local array_mt = has_array and getmetatable(array()) or {}; 19 local array_mt = has_array and getmetatable(array()) or {};
20 20
21 --module("json") 21 --module("json")
22 local module = {}; 22 local module = {};
23 23