summaryrefslogtreecommitdiff
path: root/server-beta/src/utility.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/utility.lua')
-rw-r--r--server-beta/src/utility.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/server-beta/src/utility.lua b/server-beta/src/utility.lua
index 055b35c6..c9defebc 100644
--- a/server-beta/src/utility.lua
+++ b/server-beta/src/utility.lua
@@ -431,4 +431,22 @@ function m.viewString(str, quo)
end
end
+function m.viewLiteral(v)
+ local tp = type(v)
+ if tp == 'nil' then
+ return 'nil'
+ elseif tp == 'string' then
+ return m.viewString(v)
+ elseif tp == 'boolean' then
+ return tostring(v)
+ elseif tp == 'number' then
+ if isInteger(v) then
+ return tostring(v)
+ else
+ return formatNumber(v)
+ end
+ end
+ return nil
+end
+
return m