Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lodash.reduce

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.reduce - npm Package Compare versions

Comparing version 4.1.0 to 4.1.1

115

index.js
/**
* lodash 4.1.0 (Custom Build) <https://lodash.com/>
* lodash 4.1.1 (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`

@@ -15,4 +15,4 @@ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>

hasIn = require('lodash.hasin'),
root = require('lodash._root'),
toPairs = require('lodash.topairs');
toPairs = require('lodash.topairs'),
toString = require('lodash.tostring');

@@ -23,8 +23,2 @@ /** Used to compose bitmasks for comparison styles. */

/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/** Used to match property names within property paths. */

@@ -62,19 +56,3 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,

/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Built-in value references. */
var Symbol = root.Symbol;
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = Symbol ? symbolProto.toString : undefined;
/**
* The base implementation of `_.get` without support for default values.

@@ -268,3 +246,3 @@ *

* invocation is supplied the return value of the previous. If `accumulator`
* is not provided the first element of `collection` is used as the initial
* is not given the first element of `collection` is used as the initial
* value. The iteratee is invoked with four arguments:

@@ -361,89 +339,6 @@ * (accumulator, value, index|key, collection).

/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
* This method returns the first argument given to it.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
}
/**
* Converts `value` to a string if it's not one. An empty string is returned
* for `null` and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to process.
* @returns {string} Returns the string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (value == null) {
return '';
}
if (isSymbol(value)) {
return Symbol ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* This method returns the first argument provided to it.
*
* @static
* @memberOf _
* @category Util

@@ -450,0 +345,0 @@ * @param {*} value Any value.

6

package.json
{
"name": "lodash.reduce",
"version": "4.1.0",
"version": "4.1.1",
"description": "The lodash method `_.reduce` exported as a module.",

@@ -22,7 +22,7 @@ "homepage": "https://lodash.com/",

"lodash._basereduce": "^3.0.0",
"lodash._root": "^3.0.0",
"lodash.get": "^4.0.0",
"lodash.hasin": "^4.0.0",
"lodash.topairs": "^4.0.0"
"lodash.topairs": "^4.0.0",
"lodash.tostring": "^4.0.0"
}
}

@@ -1,2 +0,2 @@

# lodash.reduce v4.1.0
# lodash.reduce v4.1.1

@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.reduce` exported as a [Node.js](https://nodejs.org/) module.

See the [documentation](https://lodash.com/docs#reduce) or [package source](https://github.com/lodash/lodash/blob/4.1.0-npm-packages/lodash.reduce) for more details.
See the [documentation](https://lodash.com/docs#reduce) or [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash.reduce) for more details.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc