-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix insentive http headers for mock flags
- Loading branch information
1 parent
55232aa
commit 33a7f9a
Showing
3 changed files
with
25 additions
and
10 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
Core/CommonKit/Sources/CommonKit/Extensions/Dictionary+Extension.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Dictionary+Extension.swift | ||
// CommonKit | ||
// | ||
// Created by Yusuf Özgül on 5.11.2024. | ||
// | ||
|
||
import Foundation | ||
|
||
public extension Dictionary where Key == String, Value == String { | ||
func caseInsensitiveSearch(for key: String) -> String? { | ||
guard let value = self.first(where: { NSString(string: $0.key).caseInsensitiveCompare(key) == .orderedSame })?.value else { return nil } | ||
return value.isEmpty ? nil : value | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters