Skip to content

Commit 2123d99

Browse files
authored
display secret value type
1 parent 84399aa commit 2123d99

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Utilities/Utils.lua

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ local DevTool = addonTable.DevTool
1111
-----------------------------------------------------------------------------------------------
1212

1313
function DevTool.normalizeSecretValue(value)
14-
if issecrettable(value) then
15-
return "<SECRET TABLE>"
16-
end
17-
if issecretvalue(value) then
18-
return "<SECRET VALUE>"
14+
if issecrettable(value) or issecretvalue(value) then
15+
return string.format("<SECRET %s>", type(value))
1916
end
2017
return value
2118
end
@@ -175,6 +172,7 @@ end
175172

176173
function DevTool.ToUIString(value, name, withoutLineBrakes)
177174
local result
175+
value = DevTool.normalizeSecretValue(value)
178176
local valueType = type(value)
179177

180178
if valueType == "table" then
@@ -184,8 +182,6 @@ function DevTool.ToUIString(value, name, withoutLineBrakes)
184182
result = tostring(value)
185183
end
186184

187-
result = DevTool.normalizeSecretValue(result)
188-
189185
if withoutLineBrakes then
190186
result = string.gsub(string.gsub(tostring(result), "|n", ""), "\n", "")
191187
end

0 commit comments

Comments
 (0)