-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapply all the changes made to satisfy GH Actions
This reverts commit 052763b. Signed-off-by: Henrik Panhans <[email protected]>
- Loading branch information
1 parent
e4f193b
commit 8c2949e
Showing
5 changed files
with
32 additions
and
44 deletions.
There are no files selected for viewing
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
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
15 changes: 3 additions & 12 deletions
15
Sources/SwiftFrameCore/Extensions/Collection+Extensions.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 |
---|---|---|
@@ -1,24 +1,15 @@ | ||
import Foundation | ||
|
||
extension Array where Element == URL { | ||
extension [URL] { | ||
|
||
func filterByFileOrFoldername(regex: NSRegularExpression?) throws -> Self { | ||
func filterByFileOrFoldername(regex: Regex<AnyRegexOutput>?) throws -> Self { | ||
guard let regex else { | ||
return self | ||
} | ||
return self.filter { url in | ||
let lastComponent = url.deletingPathExtension().lastPathComponent | ||
return regex.matches(lastComponent) | ||
return !lastComponent.matches(of: regex).isEmpty | ||
} | ||
} | ||
|
||
} | ||
|
||
extension NSRegularExpression { | ||
|
||
func matches(_ string: String) -> Bool { | ||
let range = NSRange(location: 0, length: (string as NSString).length) | ||
return firstMatch(in: string, options: [], range: range) != nil | ||
} | ||
|
||
} |
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