1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-27 12:50:04 +08:00
SpaceVim/lua/spacevim/api/data/json.lua

43 lines
688 B
Lua
Raw Normal View History

2021-08-15 19:06:48 +08:00
local M = {}
if vim.fn == nil then
fn = require('spacevim').fn
else
fn = vim.fn
end
-- M._vim = require('spacevim.api').import('vim')
-- M._iconv = require('spacevim.api').import('iconv')
function M._json_null()
return nil
end
function M._json_true()
return true
end
function M._json_false()
return false
end
if fn.exists('*json_decode') then
function M.json_decode(json)
if json == '' then
return ''
end
return fn.json_decode(json)
end
else
end
if fn.exists('*json_encode') then
function M.json_encode(val)
return fn.json_encode(val)
end
else
end
return M