UNPKG

imma

Version:

A collection of functions for dealing with native arrays and objects immutably

8 lines (6 loc) 232 B
'use strict' const objectReduce = require('../object/reduce') const reduce = module.exports = (iterable, fn, initial) => Array.isArray(iterable) ? iterable.reduce(fn, initial) : objectReduce(iterable, fn, initial)