Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
swift-urlqueryitem-coder Tests URLQueryItemCoderTests Support Extensions Standard Library URLQueryItem+Optional.swift
701 B · 30 lines
Swift
at main
12345678910111213141516171819202122232425262728293031//// URLQueryItem+Optional.swift// URLQueryItemCoder//// Created by Kyle Hughes on 12/30/22.//
import Foundation
@testable import URLQueryItemCoder
extension URLQueryItem { // MARK: Public Static Interface public static func nilIfValueIsNil(name: String, value: String?) -> URLQueryItem? { guard let value else { return nil } return URLQueryItem(name: name, value: value) } public static func nilIfValueIsNil(name: String, value: (some LosslessStringConvertible)?) -> URLQueryItem? { guard let value else { return nil } return URLQueryItem(name: name, value: value) }}