Moving stuff about/renaming

This commit is contained in:
Adam Fowler
2021-03-14 10:19:51 +00:00
parent 06251739d7
commit 5f49dd6953
5 changed files with 54 additions and 89 deletions

View File

@@ -0,0 +1,14 @@
protocol HBMustacheParent {
func child(named: String) -> Any?
}
extension HBMustacheParent {
// default child to nil
func child(named: String) -> Any? { return nil }
}
extension Dictionary: HBMustacheParent where Key == String {
func child(named: String) -> Any? { return self[named] }
}