aboutsummaryrefslogtreecommitdiffstats
path: root/teal-src/util/datamapper.tl
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-03-18 23:16:41 +0100
committerKim Alvefur <zash@zash.se>2021-03-18 23:16:41 +0100
commitd18097fb6700ede8bdb47388e51e0850d0d828f6 (patch)
tree8f63224754b87b595412c35fd88013bc299ec11f /teal-src/util/datamapper.tl
parent576b43151c407e03525623a143024bda8926e640 (diff)
downloadprosody-d18097fb6700ede8bdb47388e51e0850d0d828f6.tar.gz
prosody-d18097fb6700ede8bdb47388e51e0850d0d828f6.zip
teal: Use new integer support in Teal 0.13.0
Diffstat (limited to 'teal-src/util/datamapper.tl')
-rw-r--r--teal-src/util/datamapper.tl7
1 files changed, 4 insertions, 3 deletions
diff --git a/teal-src/util/datamapper.tl b/teal-src/util/datamapper.tl
index 86b54fc2..94387733 100644
--- a/teal-src/util/datamapper.tl
+++ b/teal-src/util/datamapper.tl
@@ -17,6 +17,7 @@
-- TODO arrays
-- TODO pointers
-- TODO cleanup / refactor
+-- TODO s/number/integer/ once we have appropriate math.type() compat
--
local st = require "util.stanza";
@@ -246,7 +247,7 @@ local function unparse ( schema : js.schema_t, t : table, current_name : string,
out.attr[attr] = v
elseif proptype == "number" and v is number then
out.attr[attr] = string.format("%g", v)
- elseif proptype == "integer" and v is number then
+ elseif proptype == "integer" and v is number then -- TODO is integer
out.attr[attr] = string.format("%d", v)
elseif proptype == "boolean" then
out.attr[attr] = v and "1" or "0"
@@ -266,7 +267,7 @@ local function unparse ( schema : js.schema_t, t : table, current_name : string,
propattr[single_attribute] = v
elseif proptype == "number" and v is number then
propattr[single_attribute] = string.format("%g", v)
- elseif proptype == "integer" and v is number then
+ elseif proptype == "integer" and v is number then -- TODO is integer
propattr[single_attribute] = string.format("%d", v)
elseif proptype == "boolean" and v is boolean then
propattr[single_attribute] = v and "1" or "0"
@@ -288,7 +289,7 @@ local function unparse ( schema : js.schema_t, t : table, current_name : string,
out:text_tag(name, v, propattr)
elseif proptype == "number" and v is number then
out:text_tag(name, string.format("%g", v), propattr)
- elseif proptype == "integer" and v is number then
+ elseif proptype == "integer" and v is number then -- TODO is integer
out:text_tag(name, string.format("%d", v), propattr)
elseif proptype == "boolean" and v is boolean then
out:text_tag(name, v and "1" or "0", propattr)