UNPKG

prray

Version:

'Promisified' Array, comes with async method supports(such as mapAsync). And it is compatible with normal array.

10 lines (7 loc) 248 B
import test from 'ava' import { toPrrayPromise } from './test-utils' const pp = toPrrayPromise([1, 2, 3, 4]) test('prraypromise findIndex', async t => { t.is(await pp.findIndex(x => x === 2), 1) t.is(await pp.findIndex(x => x === 10), -1) })