From d18097fb6700ede8bdb47388e51e0850d0d828f6 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 18 Mar 2021 23:16:41 +0100 Subject: teal: Use new integer support in Teal 0.13.0 --- teal-src/util/datamapper.tl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'teal-src/util/datamapper.tl') 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) -- cgit v1.2.3