mirror of
https://github.com/samsonjs/SJSAssetExportSession.git
synced 2026-03-26 08:55:46 +00:00
18 lines
426 B
Swift
18 lines
426 B
Swift
//
|
|
// Array+Extensions.swift
|
|
// SJSAssetExportSession
|
|
//
|
|
// Created by Sami Samhuri on 2024-10-04.
|
|
//
|
|
|
|
extension Array {
|
|
func filterAsync(_ isIncluded: (Element) async throws -> Bool) async rethrows -> [Element] {
|
|
var result: [Element] = []
|
|
for element in self {
|
|
if try await isIncluded(element) {
|
|
result.append(element)
|
|
}
|
|
}
|
|
return result
|
|
}
|
|
}
|