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

1.0.2 • 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();

Readme

Keywords

none

Package Sidebar

Install

npm i objutils

Weekly Downloads

15

Version

1.0.2

License

none

Unpacked Size

8.59 kB

Total Files

5

Last publish

Collaborators

  • tomaskafka