Skip to content

Commit 025520d

Browse files
committed
fix(util): dump
1 parent c501b42 commit 025520d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lua/lazy/util.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,20 @@ function M._dump(value, result)
237237
table.insert(result, tostring(value))
238238
elseif t == "string" then
239239
table.insert(result, ("%q"):format(value))
240+
elseif t == "table" and value._raw then
241+
table.insert(result, value._raw)
240242
elseif t == "table" then
241243
table.insert(result, "{")
242244
local i = 1
243245
---@diagnostic disable-next-line: no-unknown
244246
for k, v in pairs(value) do
245247
if k == i then
246248
elseif type(k) == "string" then
247-
table.insert(result, ("[%q]="):format(k))
249+
if k:match("^[a-zA-Z]+$") then
250+
table.insert(result, ("%s="):format(k))
251+
else
252+
table.insert(result, ("[%q]="):format(k))
253+
end
248254
else
249255
table.insert(result, k .. "=")
250256
end

0 commit comments

Comments
 (0)