Module:LuaTemplateBlueprint: Difference between revisions
// via Wikitext Extension for VSCode |
// via Wikitext Extension for VSCode |
||
| Line 1,017: | Line 1,017: | ||
end | end | ||
-- Process country and region properties with | -- Process country and region properties with early deduplication | ||
-- if a country field exists and country is not in skipProperties | -- if a country field exists and country is not in skipProperties | ||
if args.country and args.country ~= '' and not skipProperties["Has country"] then | if args.country and args.country ~= '' and not skipProperties["Has country"] then | ||
| Line 1,030: | Line 1,030: | ||
) | ) | ||
-- | -- Process country properties through deduplication | ||
if countryProperties and next(countryProperties) then | if countryProperties and next(countryProperties) then | ||
for property, values in pairs(countryProperties) do | for property, values in pairs(countryProperties) do | ||
-- Skip if explicitly marked to skip | -- Skip if explicitly marked to skip | ||
if not skipProperties[property] then | if not skipProperties[property] then | ||
if | if type(values) == "table" then | ||
-- | -- Process each value through deduplication | ||
for _, value in ipairs(values) do | |||
deduplicateProperty(collector, property, value) | |||
end | |||
else | else | ||
-- | -- Single value | ||
deduplicateProperty(collector, property, values) | |||
end | end | ||
end | end | ||