objutils
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Usage:

var input = {
	a: 1,
	b: 2
};

var mapResult = objutils.objMap(input, function(item, key, obj) {
	return item * 2;
});

t.equal(input.a, 1);
t.equal(input.b, 2);

t.equal(mapResult.a, 2);
t.equal(mapResult.b, 4);

var reduceResult = objutils.objReduce(input, function(buffer, item, key, obj) {
	return buffer + item;
}, 1);

t.equal(reduceResult, 4);

objutils.objForEach(input, function(item, key, obj) {
	// ...
}, 1);

t.done();

/objutils/

    Package Sidebar

    Install

    npm i objutils

    Weekly Downloads

    0

    Version

    1.0.4

    License

    none

    Unpacked Size

    22.4 kB

    Total Files

    7

    Last publish

    Collaborators

    • tomaskafka