From 0cd6597bec4f1b5c727cedcefe40085c6aa43c3b Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Wed, 1 May 2013 09:25:44 +0300 Subject: make persistence manager aware of data types coerce values into proper types --- acf/persistence/backends/json.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'acf/persistence/backends/json.lua') diff --git a/acf/persistence/backends/json.lua b/acf/persistence/backends/json.lua index 1ac977e..57352d8 100644 --- a/acf/persistence/backends/json.lua +++ b/acf/persistence/backends/json.lua @@ -51,12 +51,12 @@ function backend:split_path(path) end end -function backend:get(path) +function backend:get(path, tpe) local fpath, jpath = self:split_path(path) if not self.cache[fpath] then self.cache[fpath] = Cache(json.decode(util.read_file(fpath))) end - return self.cache[fpath]:get(jpath) + return self.cache[fpath]:get(jpath, tpe) end function backend:set(mods) -- cgit v1.2.3