Skip to content

Commit

Permalink
better names transform for parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM committed Jul 15, 2024
1 parent 6da19bf commit 45a316d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/EnumeratorMacroImpl/Types/EParameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ extension EParameters: MustacheTransformable {
} else {
switch name {
case "names":
let names = self.map(\.name)
let array = EOptionalsArray(underlying: names)
let names = self
.enumerated()
.map { idx, element in
element.name ?? "param\(idx + 1)"
}
let array = EArray(underlying: names)
return array
case "types":
let types = self.map(\.type)
Expand Down

0 comments on commit 45a316d

Please sign in to comment.