Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM authored Jul 18, 2024
1 parent 45b5163 commit ec51995
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ enum TestEnum {

> [!TIP]
> You can use comments in front of each case, as values for `EnumeratorMacro` to process.
> Use `;` to divide the comments, and use `:` to separate the `key` and tthe possible `value`.
> Example: `myKey1; myKey2: value; myKey3`.
```swift
@Enumerator("""
Expand Down Expand Up @@ -341,7 +343,7 @@ public enum ErrorMessage {
case case3 // business_error: false
case case4 // business_error: adfasdfdsff
case somethingSomething(value: String)
case otherCase(error: Error, isViolation: Bool) // business_error
case otherCase(error: Error, isViolation: Bool) // business_error; l8n_params:

+ package var isBusinessError: Bool {
+ switch self {
Expand Down Expand Up @@ -463,7 +465,7 @@ Here's a sample context object:

Although not visible when writing templates, each underlying value that is passed to the template engine has an actual type.

In addition to [`swift-mustache`'s own "functions"/"transforms"](https://docs.hummingbird.codes/2.0/documentation/hummingbird/transforms/), `EnumeratorMacro` supports these transformations for each type:
`EnumeratorMacro` supports these transformations for each type:

* `String`:
* `capitalized() -> String`: Capitalizes the first letter.
Expand Down

0 comments on commit ec51995

Please sign in to comment.