You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Omitted array option becomes [undefined] when an unrelated option is passed #175
Neither invocation supplies --externals, but the second adds [undefined]. This makes an omitted option appear to contain one value.
Related: #36 introduced array type support. This report concerns omitted array options.
Possible Solutions
setByType runs after each explicitly parsed option is assigned and processes all registered array options, including those that are absent. For a missing option, [obj[key]].flat() produces [undefined].
Consider skipping absent options and applying transforms once after all parsed values have been assigned, while preserving explicit defaults.
I plan to submit a fix with regression tests for omitted array options, both with and without unrelated options.
changed the title [-]传入无关选项时,未提供的数组选项变为 `[undefined]`[/-][+]Omitted array option becomes `[undefined]` when an unrelated option is passed[/+]on Sep 17, 2026
It just caused a big in production for me. Not fun filtering out [undefined] and then. checking .length > 0 just to have something default back to undefined as expected...
Love the library! Hope you can merge this fix soon!
Hi @sxzz , I explicitly stated in #175 that I would submit a fix, and submitted #176 the same day. #177 was opened four days later to address the same issue. Could you clarify whether #176 was reviewed, and why #177 was selected instead? I haven’t received any feedback on my PR and would appreciate understanding the decision.
Hi @edram, sorry for the oversight. I saw #177 first in my GitHub notifications and missed #175 and your earlier PR #176. I reviewed #177, found no issues, and merged it without realizing you had already submitted a fix. I hadn’t reviewed #176 at that point, so this wasn’t a decision based on comparing the two PRs. Thank you for reporting the bug and taking the time to submit a fix, and sorry for leaving your PR without feedback.
Activity
[-]传入无关选项时,未提供的数组选项变为 `[undefined]`[/-][+]Omitted array option becomes `[undefined]` when an unrelated option is passed[/+]fix: ignore absent array options
anselanza commentedon Oct 9, 2026
Oof, +1 from me on this one.
It just caused a big in production for me. Not fun filtering out
[undefined]and then. checking.length > 0just to have something default back toundefinedas expected...Love the library! Hope you can merge this fix soon!
edram commentedon Oct 12, 2026
Hi @sxzz , I explicitly stated in #175 that I would submit a fix, and submitted #176 the same day. #177 was opened four days later to address the same issue. Could you clarify whether #176 was reviewed, and why #177 was selected instead? I haven’t received any feedback on my PR and would appreciate understanding the decision.
sxzz commentedon Oct 12, 2026
Hi @edram, sorry for the oversight. I saw #177 first in my GitHub notifications and missed #175 and your earlier PR #176. I reviewed #177, found no issues, and merged it without realizing you had already submitted a fix. I hadn’t reviewed #176 at that point, so this wasn’t a decision based on comparing the two PRs. Thank you for reporting the bug and taking the time to submit a fix, and sorry for leaving your PR without feedback.