Skip to content

Commit b73eac3

Browse files
committed
fix(tooling): treat an empty-string dep name as invalid, not a blank dep
split_dep_names' string branch returned { "" } for an empty string while the table branch routes "" to `invalid` — the "ONE validity definition" the docstring promises was inconsistent, and a caller passing "" would surface a blank, label-less dep downstream. Route "" to `invalid` in the string branch too, matching the table branch.
1 parent a37d44f commit b73eac3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lua/modules/utils/tools.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ M.SWEEP_DELAY_MS = 120000
3333
---@return any[] invalid @Raw non-nil dropped entries, in order.
3434
local function split_dep_names(names)
3535
if type(names) == "string" then
36+
-- An empty string is invalid, same as in the table branch below — route
37+
-- it to `invalid` so the ONE validity definition holds for both shapes
38+
-- (a blank string must never read as a valid, label-less dep).
39+
if names == "" then
40+
return {}, { "" }
41+
end
3642
return { names }, {}
3743
end
3844
if type(names) ~= "table" then

0 commit comments

Comments
 (0)