mas/MasKit/Extensions/Dictionary+StringOrEmpty.swift

16 lines
278 B
Swift
Raw Normal View History

//
// Dictionary+StringOrEmpty.swift
// MasKit
//
// Created by Ben Chatelain on 1/7/19.
// Copyright © 2019 mas-cli. All rights reserved.
//
import Foundation
extension Dictionary {
func stringOrEmpty(key: Key) -> String {
2021-03-22 05:46:17 +00:00
self[key] as? String ?? ""
}
}