some
fun some(fn: (data: Any?, options: ArrayOptions?) -> PromiseResult<Boolean>, options: ArrayOptions = definedExternally): Promise<Boolean>(source)
This method is similar to Array.prototype.some
and calls fn on each chunk in the stream until the awaited return value is true
(or any truthy value). Once an fn call on a chunk await
ed return value is truthy, the stream is destroyed and the promise is fulfilled with true
. If none of the fn calls on the chunks return a truthy value, the promise is fulfilled with false
.
Since
v17.5.0
Parameters
fn
a function to call on each chunk of the stream. Async or not.