This commit is contained in:
David Roman 2023-06-03 15:01:19 +01:00
parent c4889a0004
commit 4af686c887
No known key found for this signature in database
GPG Key ID: 7058646EEFCB70A7
1 changed files with 4 additions and 2 deletions

View File

@ -59,11 +59,13 @@ public protocol PlatformEntity: AnyObject {
}
extension PlatformEntity {
var ancestors: some Sequence<Base> {
@_spi(Internals)
public var ancestors: some Sequence<Base> {
sequence(first: self~, next: { $0.ancestor~ }).dropFirst()
}
var allDescendants: [Base] {
@_spi(Internals)
public var allDescendants: [Base] {
self.descendants.reduce([self~]) { $0 + $1.allDescendants~ }
}