Skip to content

Commit

Permalink
Merge pull request #46 from SwiftGen/feature/breaking/rename-stringto…
Browse files Browse the repository at this point in the history
…swiftidentifier

Rename (internal) stringToSwiftIdentifier
  • Loading branch information
AliSoftware authored May 27, 2017
2 parents 01f00e8 + ff17c5b commit 12db7b1
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ Due to the removal of legacy code, there are a few breaking changes in this new
* Refactored the `snakeToCamelCase` filter to now accept an (optional) boolean parameter to control the `noPrefix` behaviour.
[David Jennes](https://github.com/djbe)
[#41](https://github.com/SwiftGen/StencilSwiftKit/pull/41)
* Rename the `stringToSwiftIdentifier` function to `swiftIdentifier` to better match the other method names.
[David Jennes](https://github.com/djbe)
[#46](https://github.com/SwiftGen/StencilSwiftKit/pull/46)

### New Features

Expand Down
4 changes: 4 additions & 0 deletions Documentation/MigrationGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ We've removed the following deprecated `typealias`es:
* `ParametersError`: use `Parameters.Error` instead.
* `NumFilters`: use `Filters.Numbers` instead.
* `StringFilters`: use `Filters.Strings` instead.

The following functions have been renamed:

* `stringToSwiftIdentifier` renamed to `swiftIdentifier`.
26 changes: 13 additions & 13 deletions Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Sources/Environment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public extension Extension {
registerTag("macro", parser: MacroNode.parse)
registerTag("call", parser: CallNode.parse)
registerTag("map", parser: MapNode.parse)
registerFilter("swiftIdentifier", filter: Filters.Strings.stringToSwiftIdentifier)
registerFilter("swiftIdentifier", filter: Filters.Strings.swiftIdentifier)
registerFilter("lowerFirstWord", filter: Filters.Strings.lowerFirstWord)
registerFilter("snakeToCamelCase", filter: Filters.Strings.snakeToCamelCase)
registerFilter("camelToSnakeCase", filter: Filters.Strings.camelToSnakeCase)
Expand Down
4 changes: 2 additions & 2 deletions Sources/Filters+Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ extension Filters {
"right", "set", "Type", "unowned", "weak", "willSet"
]

static func stringToSwiftIdentifier(value: Any?) throws -> Any? {
static func swiftIdentifier(_ value: Any?) throws -> Any? {
guard let value = value as? String else { throw Filters.Error.invalidInputType }
return swiftIdentifier(from: value, replaceWithUnderscores: true)
return StencilSwiftKit.swiftIdentifier(from: value, replaceWithUnderscores: true)
}

/* - If the string starts with only one uppercase letter, lowercase that first letter
Expand Down

0 comments on commit 12db7b1

Please sign in to comment.