Fix: allow empty path in utils.get_at_path

This commit is contained in:
Stephan Seitz 2021-04-05 14:40:22 +02:00 committed by Stephan Seitz
parent 06c9ef8104
commit 826683b1bf
2 changed files with 4 additions and 6 deletions

View file

@ -111,6 +111,7 @@ end
-- @param path the '.' separated path
-- @returns the value at path or nil
function M.get_at_path(tbl, path)
if path == '' then return tbl end
local segments = vim.split(path, '.', true)
local result = tbl