All Projects → jonschlinkert → Object.reduce

jonschlinkert / Object.reduce

Licence: mit
Reduces an object to a value that is the accumulated result of running each property in the object through a callback. JavaScript/node.js utility.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Object.reduce

arr-flatten
Recursively flatten an array or arrays. This is the fastest implementation of array flatten.
Stars: ✭ 55 (+400%)
Mutual labels:  utility, util
Schematics Utilities
🛠️ Useful exported utilities for working with Schematics
Stars: ✭ 73 (+563.64%)
Mutual labels:  utility, util
action-sync-node-meta
GitHub Action that syncs package.json with the repository metadata.
Stars: ✭ 25 (+127.27%)
Mutual labels:  utility, util
has-value
Returns true if a value exists, false if empty. Works with deeply nested values using object paths.
Stars: ✭ 27 (+145.45%)
Mutual labels:  object, util
go-tools
A utility tool library of Golang.
Stars: ✭ 44 (+300%)
Mutual labels:  utility, util
Remeda
A utility library for JavaScript and TypeScript.
Stars: ✭ 774 (+6936.36%)
Mutual labels:  utility
Cue Maker
A simple and easy to use program that fetches original cue files for your roms.
Stars: ✭ 19 (+72.73%)
Mutual labels:  utility
Utils
A collection of useful PHP functions, mini classes and snippets that you need and can use every day.
Stars: ✭ 750 (+6718.18%)
Mutual labels:  utility
Reloading
Change Python code while it's running without losing state
Stars: ✭ 723 (+6472.73%)
Mutual labels:  utility
Bonjourmadame
Say "Hello ma'am!"
Stars: ✭ 9 (-18.18%)
Mutual labels:  utility
W10 Cleanser
Remove advertising, disable data collection, annoying notifications, default apps and more. Ideal for fresh installs of Windows 10 and those looking to purify their current installation.
Stars: ✭ 24 (+118.18%)
Mutual labels:  utility
Mini Observable
A mini implementation of TC39 observables, plus some utils!
Stars: ✭ 16 (+45.45%)
Mutual labels:  utility
Pie
🍕 Enjoy a slice! A utility library for dealing with slices and maps that focuses on type safety and performance.
Stars: ✭ 788 (+7063.64%)
Mutual labels:  utility
Slowquitapps
Add a global delay to Command-Q to stop accidental app quits.
Stars: ✭ 916 (+8227.27%)
Mutual labels:  utility
Engauge Digitizer
Extracts data points from images of graphs
Stars: ✭ 754 (+6754.55%)
Mutual labels:  utility
Cs.2click
🔊 A Better Audio Router for a Modular System.
Stars: ✭ 7 (-36.36%)
Mutual labels:  utility
Pydash
The kitchen sink of Python utility libraries for doing "stuff" in a functional way. Based on the Lo-Dash Javascript library.
Stars: ✭ 728 (+6518.18%)
Mutual labels:  utility
Vault2env
Small utility to transfer fields of a key in Vault into the environment
Stars: ✭ 6 (-45.45%)
Mutual labels:  utility
Shallow Clone
Make a shallow clone of an object, array or primitive.
Stars: ✭ 23 (+109.09%)
Mutual labels:  object
Xonotic Map Manager
A command line package manager for Xonotic community maps
Stars: ✭ 5 (-54.55%)
Mutual labels:  utility

object.reduce NPM version NPM monthly downloads Linux Build Status

Reduces an object to a value that is the accumulated result of running each property in the object through a callback.

Install

Install with npm:

$ npm install --save object.reduce

Install with yarn:

$ yarn add object.reduce

Install with bower

$ bower install object.reduce --save

Usage

the initial value (or value from the previous callback call), the value of the current property, the key of the current property, and the object over which the function is iterating. Node.js/JavaScript utility.)_

Params

  • object {Object}: The object to iterate over (the iteratee)
  • fn {Function}: The function invoked per iteration.
  • init {Object}: The initial value to use for the accumulator.
  • thisArg {Object}: (optional) Object to use as the invocation context for the iterator (expose as this inside the iterator)

Executes the given callback fn once for each own enumerable property in the object. The callback receives the following arguments:

  • acc: the initial value (or value from the previous callback call),
  • value: the of the current property,
  • key: the of the current property, and
  • the original object over which the function is iterating.

Example

var reduce = require('object.reduce');
var a = {a: 'foo', b: 'bar', c: 'baz'};

reduce(a, function(acc, value, key, obj) {
  acc[key] = value.toUpperCase();
  return acc;
}, {});

//=> {a: 'FOO', b: 'BAR', c: 'BAZ'};

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.5.0, on April 17, 2017.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].