@barefootjs/go-template 0.5.3 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -355,7 +355,14 @@ function goMapLiteralFromObject(
355
355
  else if (typeof v === 'number') entries.push(`${key}: ${v}`)
356
356
  else if (typeof v === 'boolean') entries.push(`${key}: ${v}`)
357
357
  else if (v === null) entries.push(`${key}: nil`)
358
- else if (v && typeof v === 'object' && !Array.isArray(v)) {
358
+ else if (Array.isArray(v)) {
359
+ // Array-valued field inside an object-in-array (e.g. the `tags`
360
+ // of `items.flatMap(i => i.tags)`). Without this branch the field
361
+ // was silently dropped, leaving an empty map so the template
362
+ // rendered nothing for the projection (#1448 Tier C flatMap).
363
+ entries.push(`${key}: ${goArrayLiteralFromArray(v)}`)
364
+ }
365
+ else if (v && typeof v === 'object') {
359
366
  entries.push(`${key}: ${goMapLiteralFromObject(v as Record<string, unknown>, capitalizeKeys)}`)
360
367
  }
361
368
  }