mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Bump to v3.0.1.
This commit is contained in:
committed by
John-David Dalton
parent
bb53dde973
commit
60b8329a73
@@ -1,4 +1,4 @@
|
||||
# lodash.transform v3.0.0
|
||||
# lodash.transform v3.0.1
|
||||
|
||||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.transform` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
||||
|
||||
@@ -17,4 +17,4 @@ In Node.js/io.js:
|
||||
var transform = require('lodash.transform');
|
||||
```
|
||||
|
||||
See the [documentation](https://lodash.com/docs#transform) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.transform) for more details.
|
||||
See the [documentation](https://lodash.com/docs#transform) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.transform) for more details.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* lodash 3.0.0 (Custom Build) <https://lodash.com/>
|
||||
* lodash 3.0.1 (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash modern modularize exports="npm" -o ./`
|
||||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE>
|
||||
@@ -11,6 +11,7 @@ var arrayEach = require('lodash._arrayeach'),
|
||||
baseCreate = require('lodash._basecreate'),
|
||||
baseFor = require('lodash._basefor'),
|
||||
isArray = require('lodash.isarray'),
|
||||
isFunction = require('lodash.isfunction'),
|
||||
isTypedArray = require('lodash.istypedarray'),
|
||||
keys = require('lodash.keys');
|
||||
|
||||
@@ -74,18 +75,16 @@ function isObject(value) {
|
||||
* @returns {*} Returns the accumulated value.
|
||||
* @example
|
||||
*
|
||||
* var squares = _.transform([1, 2, 3, 4, 5, 6], function(result, n) {
|
||||
* n *= n;
|
||||
* if (n % 2) {
|
||||
* return result.push(n) < 3;
|
||||
* }
|
||||
* _.transform([2, 3, 4], function(result, n) {
|
||||
* result.push(n *= n);
|
||||
* return n % 2 == 0;
|
||||
* });
|
||||
* // => [1, 9, 25]
|
||||
* // => [4, 9]
|
||||
*
|
||||
* var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, n, key) {
|
||||
* _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) {
|
||||
* result[key] = n * 3;
|
||||
* });
|
||||
* // => { 'a': 3, 'b': 6, 'c': 9 }
|
||||
* // => { 'a': 3, 'b': 6 }
|
||||
*/
|
||||
function transform(object, iteratee, accumulator, thisArg) {
|
||||
var isArr = isArray(object) || isTypedArray(object);
|
||||
@@ -97,7 +96,7 @@ function transform(object, iteratee, accumulator, thisArg) {
|
||||
if (isArr) {
|
||||
accumulator = isArray(object) ? new Ctor : [];
|
||||
} else {
|
||||
accumulator = baseCreate(typeof Ctor == 'function' && Ctor.prototype);
|
||||
accumulator = baseCreate(isFunction(Ctor) && Ctor.prototype);
|
||||
}
|
||||
} else {
|
||||
accumulator = {};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash.transform",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"description": "The modern build of lodash’s `_.transform` as a module.",
|
||||
"homepage": "https://lodash.com/",
|
||||
"icon": "https://lodash.com/icon.svg",
|
||||
@@ -22,6 +22,7 @@
|
||||
"lodash._basecreate": "^3.0.0",
|
||||
"lodash._basefor": "^3.0.0",
|
||||
"lodash.isarray": "^3.0.0",
|
||||
"lodash.isfunction": "^3.0.0",
|
||||
"lodash.istypedarray": "^3.0.0",
|
||||
"lodash.keys": "^3.0.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user