-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: update the implementation of CapitalizationRule to be more f…
…lexible
- Loading branch information
1 parent
8272e9f
commit 0638c5f
Showing
1 changed file
with
16 additions
and
6 deletions.
There are no files selected for viewing
22 changes: 16 additions & 6 deletions
22
apollo-ios-codegen/Sources/ApolloCodegenLib/Capitalizer.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
import Foundation | ||
|
||
public enum CapitalizationRule: Codable, Equatable { | ||
case uppercase(regex: String) | ||
case lowercase(regex: String) | ||
case titlecase(regex: String) | ||
case camelcase(regex: String) | ||
case pascalcase(regex: String) | ||
struct CapitalizationRule: Codable, Equatable { | ||
enum Term: Codable, Equatable { | ||
case string(String) | ||
case regex(String) | ||
} | ||
|
||
enum Strategy: Codable, Equatable { | ||
case uppercase | ||
case lowercase | ||
case titlecase | ||
case camelcase | ||
case pascalcase | ||
} | ||
|
||
let term: Term | ||
let strategy: Strategy | ||
} |