repositories / dotfiles
dotfiles
bugabingas dorkfiles
owned by admin
neovim/lua/std/dbg/encode.lua
Raw---Encodes a debug event to JSON.
---@param event table debug event
---@return string json
local function encode( event )
return vim.json.encode( event, {
escape_slash = true,
} )
end
---Decodes a JSON line into a debug event.
---@param line string JSON string
---@return table event
local function decode( line )
return vim.json.decode( line, {
luanil = {
object = true,
array = true,
},
} )
end
return {
encode = encode,
decode = decode,
}