This commit is contained in:
Justin M. Keyes
2025-01-01 12:29:51 -08:00
committed by GitHub
parent 9d114b7205
commit dc692f553a
15 changed files with 151 additions and 113 deletions

View File

@@ -25,18 +25,18 @@ vim.json = {}
---
---@param str string Stringified JSON data.
---@param opts? table<string,any> Options table with keys:
--- - luanil: (table) Table with keys:
--- * object: (boolean) When true, converts `null` in JSON objects
--- to Lua `nil` instead of |vim.NIL|.
--- * array: (boolean) When true, converts `null` in JSON arrays
--- to Lua `nil` instead of |vim.NIL|.
--- - luanil: (table) Table with keys:
--- - object: (boolean) When true, converts `null` in JSON objects
--- to Lua `nil` instead of |vim.NIL|.
--- - array: (boolean) When true, converts `null` in JSON arrays
--- to Lua `nil` instead of |vim.NIL|.
---@return any
function vim.json.decode(str, opts) end
--- Encodes (or "packs") Lua object {obj} as JSON in a Lua string.
---@param obj any
---@param opts? table<string,any> Options table with keys:
--- - escape_slash: (boolean) (default false) When true, escapes `/`
--- character in JSON strings
--- - escape_slash: (boolean) (default false) Escape slash
--- characters "/" in string values.
---@return string
function vim.json.encode(obj, opts) end