Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
object.reduce
Advanced tools
Reduces an object to a value that is the accumulated result of running each property in the object through a callback.
Reduces an object to a value that is the accumulated result of running each property in the object through a callback.
Install with npm:
$ npm install --save object.reduce
Install with yarn:
$ yarn add object.reduce
Install with bower
$ bower install object.reduce --save
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, andobject
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'};
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
(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 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
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.5.0, on April 17, 2017.
FAQs
Reduces an object to a value that is the accumulated result of running each property in the object through a callback.
The npm package object.reduce receives a total of 765,746 weekly downloads. As such, object.reduce popularity was classified as popular.
We found that object.reduce demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.