Skip to content

Mapping: each and when blocks #23

@alvinreal

Description

@alvinreal

Description

Implement each (iterate over array elements) and when (conditional blocks).

TDD Tests

each

  • each .items { rename .x -> .y } applies to every element
  • each .items { set .total = .price * .qty } computed fields per element
  • each on non-array → error
  • each with multiple operations inside block
  • Nested each: each .groups { each .members { ... } }
  • each on empty array → no-op

when

  • when .type == "admin" { set .perms = [...] } applies conditionally
  • when condition false → block skipped
  • when with else (if we support it, or defer)
  • Multiple when blocks → all evaluated independently
  • Nested when inside each
  • when inside each: per-element conditional

Part of #3

Metadata

Metadata

Assignees

No one assigned

    Labels

    mappingMapping languagetestingTesting infrastructurev0.3.0Milestone: v0.3.0 Advanced Mappings

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions