The variable `propagatedBuildOutputs` was only allowed to be a string,
so when `__structuredAttrs = true` was set, it was incorrectly detected,
especially for empty arrays. Refactor the code to allow it to be either
an array or string.
Closes: #323126