Function
some
(predicate: Predicate<A>)
Source from the content-addressed store, hash-verified
| 132 | * true if one or more elements match predicate |
| 133 | */ |
| 134 | export function some<A>(predicate: Predicate<A>): (set: Set<A>) => boolean { |
| 135 | return (set) => { |
| 136 | const values = set.values() |
| 137 | let e: Next<A> |
| 138 | let found = false |
| 139 | while (!found && !(e = values.next() as any).done) { |
| 140 | found = predicate(e.value) |
| 141 | } |
| 142 | return found |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * true if one or more elements match predicate |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…