-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.lua
More file actions
42 lines (36 loc) · 741 Bytes
/
Copy pathutils.lua
File metadata and controls
42 lines (36 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
local utils = {}
function utils.fusionTable(a, b)
if type(a) == 'table' and type(b) == 'table' then
for k, v in pairs(b) do
a[k] = v
end
end
return a
end
local function unTable(t)
if type(t) == 'table' then
local s = '{\n'
for k,v in pairs(t) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. ' ['..k..'] = ' .. unTable(v) .. ',\n'
end
return s .. '} '
else
return tostring(t)
end
end
function table.removeByValue( t, value )
for k, v in pairs(t) do
if v == value then
t[k] = nil
end
end
return t
end
function PrintTable(t)
print( unTable(t) )
end
function CurTime()
return os.clock()
end
return utils