Skip to content

Commit

Permalink
Add missing locale support in matchesTokenizedPrefixes() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Mar 31, 2024
1 parent 25fe062 commit 09a9ff7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/HandySwift/Extensions/StringExt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ extension String {
/// print(searchResult) // Output: true
/// ```
public func matchesTokenizedPrefixes(in searchText: String, locale: Locale? = nil) -> Bool {
let tokens = self.tokenized()
return searchText.tokenized().allSatisfy { searchToken in
let tokens = self.tokenized(locale: locale)
return searchText.tokenized(locale: locale).allSatisfy { searchToken in
tokens.contains { $0.hasPrefix(searchToken) }
}
}
Expand Down

0 comments on commit 09a9ff7

Please sign in to comment.