Moving stuff about/renaming
This commit is contained in:
14
Sources/HummingbirdMustache/Parent.swift
Normal file
14
Sources/HummingbirdMustache/Parent.swift
Normal 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] }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user