UNPKG

rambdax

Version:

Extended version of Rambda - a lightweight, faster alternative to Ramda

14 lines (11 loc) 403 B
import { isArray } from './_internals/isArray.js' import { partitionArray, partitionObject } from './partition.js' export function partitionIndexed(predicate, iterable){ if (arguments.length === 1){ return listHolder => partitionIndexed(predicate, listHolder) } if (!isArray(iterable)) return partitionObject(predicate, iterable) return partitionArray( predicate, iterable, true ) }