Merge branch 'feature/optional_array' into 'develop'
optional array See merge request BPHV_MIPS/mvm_core!9
This commit is contained in:
commit
f1df88bffe
@ -52,6 +52,10 @@ public extension Dictionary {
|
|||||||
return array
|
return array
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func optionalArrayForChainOfKeysOrIndexes(_ keysOrIndexes: [Any]) -> [Any]? {
|
||||||
|
return objectChainOfKeysOrIndexes(keysOrIndexes) as? [Any]
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns a Dictionary after looking up the specified key. An empty dictionary is returned if a dictionary for the key does not exist
|
/// Returns a Dictionary after looking up the specified key. An empty dictionary is returned if a dictionary for the key does not exist
|
||||||
func dictionaryForKey(_ key : String) -> [String : Any] {
|
func dictionaryForKey(_ key : String) -> [String : Any] {
|
||||||
|
|
||||||
@ -76,6 +80,13 @@ public extension Dictionary {
|
|||||||
return arrayForChainOfKeysOrIndexes([key])
|
return arrayForChainOfKeysOrIndexes([key])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func optionalArrayForKey(_ key : String) -> [Any]? {
|
||||||
|
guard let key = key as? Key else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return self[key] as? [Any]
|
||||||
|
}
|
||||||
|
|
||||||
/// Return a Bool after looking up the specified key. This will return false if the key does not exist
|
/// Return a Bool after looking up the specified key. This will return false if the key does not exist
|
||||||
func boolForKey(_ key : String) -> Bool {
|
func boolForKey(_ key : String) -> Bool {
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user