Skip to content

Commit

Permalink
Update Sources/LicenseCheckerModule/LicenseType.swift
Browse files Browse the repository at this point in the history
Co-authored-by: Takuto NAKAMURA (Kyome) <[email protected]>
  • Loading branch information
tochi86 and Kyome22 authored Jan 27, 2025
1 parent 18c1b02 commit eb235e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/LicenseCheckerModule/LicenseType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ public enum LicenseType: String {
self = types.compactMap { key, value -> (LicenseType, String.Index)? in
guard let range = value
.compactMap({ text.range(of: $0) })
.min(by: { $0.lowerBound < $1.lowerBound })
else { return nil }
.min(by: { $0.lowerBound < $1.lowerBound }) else {
return nil
}
return (key, range.lowerBound)
}
.min(by: { $0.1 < $1.1 })?.0 ?? .unknown
Expand Down

0 comments on commit eb235e0

Please sign in to comment.