diff --git a/async.coffee b/async.coffee index 06f5258..5af80fe 100644 --- a/async.coffee +++ b/async.coffee @@ -90,11 +90,11 @@ module.exports = async = detectSeries: Q.promised (arr, iterator, _notFound=undefined) -> return Q _notFound if arr.length is 0 - iterator(arr[0]).then (ok) -> + Q(iterator(arr[0])).then (ok) -> if ok arr[0] else - async.detectSeries arr[1..], iterator + async.detectSeries arr[1..], iterator, _notFound # [a] -> (a -> P b) -> [a] # basically a swartzian transform