Project template updates (#25)

* Project template updates

* More changes

* run swiftformat
This commit is contained in:
Adam Fowler
2024-03-08 12:04:49 +00:00
committed by GitHub
parent f5177888f9
commit f029081b61
13 changed files with 50 additions and 68 deletions

View File

@@ -63,21 +63,19 @@ struct HBMustacheContext {
/// return context with indent and parameter information for invoking a partial
func withPartial(indented: String?, inheriting: [String: HBMustacheTemplate]?) -> HBMustacheContext {
let indentation: String?
if let indented = indented {
indentation = (self.indentation ?? "") + indented
let indentation: String? = if let indented {
(self.indentation ?? "") + indented
} else {
indentation = self.indentation
self.indentation
}
let inherits: [String: HBMustacheTemplate]?
if let inheriting = inheriting {
let inherits: [String: HBMustacheTemplate]? = if let inheriting {
if let originalInherits = self.inherited {
inherits = originalInherits.merging(inheriting) { value, _ in value }
originalInherits.merging(inheriting) { value, _ in value }
} else {
inherits = inheriting
inheriting
}
} else {
inherits = self.inherited
self.inherited
}
return .init(
stack: self.stack,

View File

@@ -182,7 +182,7 @@ extension HBMustacheTemplate {
}
// if we want to run a transform and the current child can have transforms applied to it then
// run transform on the current child
if let transform = transform {
if let transform {
if let runnable = child as? HBMustacheTransformable {
return runnable.transform(transform)
}