-
Notifications
You must be signed in to change notification settings - Fork 0
Changelog
See the v4.0.0 release notes for an overview of what’s new in 4.0.0. Use lodash-migrate, lodash-codemods, & eslint-plugin-lodash to help migrate pre-4 lodash code to the latest release.
- Fixed backtick removal of
_.escape
&_.unescape
- Improved parse time by 2x in V8
- Added
fp.rangeStep
&fp.rangeStepRight
- Added a cache limit to internal
_.memoize
use - Avoided V8 de-opts in
_.isElement
,_.isObject
, &_.isObjectLike
- Dropped backtick encoding from
_.escape
&_.unescape
- Dropped testing in Node.js 0.10 & 0.12
- Ensured
__proto__
is treated as a regular key in assignments - Fixed
_.bind
&_.partial
performance regression - Optimized
_.concat
- Added Latin Extended-A block support to
_.deburr
- Reduced dependencies of
_.isEmpty
&_.toNumber
- Ensured methods work with mocked
Date.now
,clearTimeout
, &setTimeout
- Ensured paths of “set” methods overwrite primitives
- Ensured
fp.nthArg
returns a curried function - Reduced dependencies of
_.initial
,_.merge
, &_.tail
- Removed old JIT & engine bug guards
- Ensured paths with consecutive empty brackets or dots are parsed correctly
- Ensured
_.random
& “range” methods coerce arguments to finite numbers - Fixed circular reference detection in
_.cloneDeep
- Removed
global
prerequisite forexports
detection
- Added _.conformsTo & _.defaultTo
- Added more “fp” aliases
- Added “All” variants of
fp/assign
,fp/defaults
,fp/merge
, &fp/zip
methods - Ensured debounced
cancel
usesclearTimeout
- Ensured the alias
_.first
supports shortcut fusion - Ensured
_.assignWith
respectscustomizer
results ofundefined
- Ensured
_.divide
&_.multiply
return1
when no arguments are specified - Ensured
_.isEqual
has transitive equivalence for circular references - Fixed argument order of
fp/zipObjectDeep
- Simplified resolving the global object
- Stopped unconditional global exports in the browser
- Made per method packages zero-dependency modules
- Made wrapped function
toString
results more debuggable - Made “flatten” methods honor
Symbol.isConcatSpreadable
- Made
_.isEqual
treat invalid dates as equivalent - Made
LARGE_ARRAY_SIZE
check instackSet
align with others - Optimized adding values to stacks by not inspecting all key-value pairs
- Optimized “isType” methods to use faster Node.js C++ helpers when available
- Optimized
_.endsWith
,_.negate
, &_.startsWith
- Ensured
_.find
&_.findLast
provide the correctkey
param when iterating objects
- Added _.stubArray, _.stubFalse, _.stubObject, _.stubString, & _.stubTrue
- Added
fromIndex
param to_.find
,_.findIndex
,_.findLast
, &_.findLastIndex
- Ensured empty brackets & dots in paths are treated as empty property names
- Ensured
_.pullAll
works with the same value forarray
&values
- Ensured
_.round
works with largeprecision
values - Ensured
_.throttle
works with a system time of0
- Made
_.isNative
throw ifcore-js
is detected - Simplified UMD exports
- Added
fp/findFrom
,fp/findIndexFrom
,fp/findLastFrom
,fp/findLastIndexFrom
,fp/indexOfFrom
, &fp/lastIndexOfFrom
- Fixed argument order of
fp/differenceBy
,fp/differenceWith
,fp/intersectionBy
,fp/intersectionWith
,fp/without
,fp/unionBy
,fp/unionWith
,fp/xorBy
, &fp/xorWith
- Added _.toFinite
- Added iteratee arity hints to “forEach” methods
- Added support for maps & sets to
_.toPairs
&_.toPairsIn
- Ensured
_.merge
doesn’t skip trailing function sources - Ensured
fp/forEach
,fp/forIn
, &fp/forOwn
cap their iteratee arguments - Ensured
fp/update
does not convert end ofpath
to an object - Ensured matches methods match arrays with duplicate values
- Optimized “flatten” methods
- Simplified
_.concat
- Updated cache implementations
- Ensured
_.pullAt
correctly sorts indexes greater than9
- Ensured
_.words
doesn’t treat punctuation as words - Ensured
-0
works as path arguments - Ensured set methods like
_.uniq
&_.xor
convert-0
to0
- Added
fp/pluck
as an alias offp/map
- Ensured
_.debounce
defers invokingfunc
whenleading
isfalse
&wait
is0
- Added _.nth
- Added
_.matchesProperty
shorthand support to_.sortBy
- Added support for contractions to case methods &
_.words
- Avoided unnecessary array cloning in
createRecurryWrapper
&mergeData
- Ensured
fp/over
doesn’t cap its iteratee arguments - Made
_.head
avoid accessingarray
when its length is0
- Added
isIterateeCall
check to_.split
- Added
fp/paths
&fp/props
as aliases offp/at
- Added
fp/propEq
as an alias offp/matchesProperty
- Ensured
_.debounce
queues a trailing call for subsequent debounced calls aftermaxWait
- Ensured
_.split
handles alimit
of0
correctly in Node.js v0.10 - Optimized handling of emojis in string methods
- Removed
fp/mapObj
&fp/propOf
aliases
- Added back
_.matchesProperty
shorthand support to “over” methods - Ensured
_.split
works with emojis - Fixed malformed
fp/toString
&fp/valueOf
modules
- Reverted
_.matchesProperty
shorthand support for “over” methods
- Fixed typo in
fp/_falseOptions
- Added
fp/placeholder
module &fp/__
alias - Added
convert
to unconverted “fp” methods - Added
_.matchesProperty
shorthand support to “over” methods - Avoided errors in older Firefoxes when coercing
Promise
to a string - Ensured
_.has
returnsfalse
for nested nullish object values - Ensured
_.has
treats nested sparse arrays consistently - Fixed argument order of
fp/overArgs
- Made
_.chunk
,_.repeat
, &_.sampleSize
defaultn
to1
instead of0
- Optimized
_.matchesProperty
shorthand
- Added _.divide, _.flatMapDeep, _.flatMapDepth, _.meanBy, & _.multiply
- Added fp/convert,
fp/invokeArgs
,fp/invokeArgsMap
,fp/padChars
,fp/padCharsEnd
,fp/padCharsStart
,fp/restFrom
, &fp/spreadFrom
- Added
_.entries
as an alias of_.toPairs
- Added
_.entriesIn
as an alias of_.toPairsIn
- Added several “fp” aliases
- Added support for buffers to
_.isEmpty
- Added support for maps & sets to
_.isEmpty
&_.size
- Added support for deep cloning data views, maps, & sets
- Added symbol support to
_.omit
,_.toNumber
, &_.toPath
- Avoided a JIT bug in Safari 9 for
baseIteratee
- Ensured array sequence methods don’t error for falsey values
- Ensured
_.concat
casts non-arrayarray
values to arrays - Ensured
_.has
returnsfalse
for nested inherited properties - Ensured
_.isEqual
compares promises by reference - Ensured
_.isPlainObject
returnsfalse
for objects with a custom[[Prototype]]
- Ensured
_.mergeWith
sources are cloned whencustomizer
returnsundefined
- Ensured
_.startCase
only uppercases the first character of each word - Ensured
_.words
detects words where an all caps word is next to a capitalized word - Fixed argument order of
fp/bind
,fp/bindKey
, &fp/isEqualWith
- Fixed aliases
fp/all
,fp/any
, &fp/anyPass
- Made
_.result
resolve values of functions as it deep crawls over them - Memoized
stringToPath
- Optimized
_.pad
,_.padEnd
,_.padStart
, &_.toNumber
- Refactored
_.debounce
to simplify, reduce timers, & fix bugs
- Optimized
baseClone
to avoid cloning symbols for internal use
- Added _.pullAllWith, _.update, & _.updateWith
- Added
core.min.js
&lodash.min.js
to the “fp” module ignored list - Ensured
_.defaultsDeep
does not overwrite regexp values - Ensured
_.isEqual
works with maps & sets with circular references - Ensured “fp” uses
lodash
as the default placeholder - Ensured
stack
is popped after a recursive merge so that it doesn’t affect sibling properties - Fixed order of arguments in “fp” docs
- Optimized
baseIsEqualDeep
by removing a typed array check & unnecessary stack creation - Optimized
_.assign
,_.assignIn
, &_.intersection
- Optimized
_.merge
to avoid deep cloning sources if acustomizer
is provided - Removed dead code from
getNative
- Replaced
Symbol
checks withSymbol
methods checks
- Added
core.min.js
&lodash.min.js
to the npm package - Ensured placeholders persist through more than one curried call
- Ensured
assignValue
assigns values if they aren’t the same own value - Ensured “fp” methods avoid unnecessary cloning
- Ensured
fp/omitBy
&fp/pickBy
providevalue
&key
params to iteratees - Fixed arity of
fp/orderBy
- Used
getPrototypeOf
to set inheritance whenconstructor
is a function
- Enabled support for cloning expando properties of boolean, number, & string objects
- Ensured
fp/convert
wrappers support iteratee shorthands
- Added _.castArray & _.flattenDepth
- Fixed argument order of
fp/inRange
&fp/zipWith
- Enabled
fp/convert
to auto wraplodash
in the browser - Enabled
fp/convert
to work when givenlodash
withoptions
- Ensured
fp/convert
options works when applied individually - Ensured
fp/convert
works with category modules - Ensured
_.isError
works with subclassed values - Ensured
_.merge
deep clones array, typed-array, & plain-object sources - Ensured a debounced
maxWait
timeout isn’t processed on a leading call whenleading
isfalse
& there isn’t a max delay queued
- Added _.isArrayBuffer, _.isBuffer, _.isMap, _.isSet, _.isWeakMap, & _.isWeakSet
- Added options param to
fp/convert
- Ensured default placeholder values are set for relevant method modules
- Ensured
_.add
&_.subtract
return0
when no arguments are given - Ensured
fp/gt
,fp/gte
,fp/lt
, &fp/lte
don’t haverearg
applied - Improved accuracy of
_.debounce
&_.throttle
- Added remap of
fp/trim
asfp/trimChars
forchars
param support - Ensured wrapped
_.bind
,_.curry
, &_.partial
support placeholders - Ensured
fp/_baseConvert
uses_.spread
for_.partial
wrapper - Ensured
fp/add
&fp/subtract
don’t haverearg
applied
- Added
fp/assoc
&fp/assocPath
as aliases offp/set
- Added
fp/dissoc
&fp/dissocPath
as aliases offp/unset
- Added
start
param to_.spread
- Ensured
_.attempt
preserves custom errors - Ensured
fp/partial
&fp/partialRight
accept anargs
param - Ensured
fp/unset
is immutable - Ensured
_.iteratee
clones sources for_.matchesProperty
shorthand - Made
_.flatMap
a “Collection” method - Removed
global
references from the npm package
- Added _.invertBy & _.zipObjectDeep
- Added cherry pickable “fp” method modules to the npm package
- Ensured
fp/convert
works with aliases - Ensured
_.clone
&_.cloneDeep
work on prototype objects - Ensured
_.mergeWith
overwrites primitives with source object clones - Ensured
_.sum
&_.sumBy
return0
for empty arrays - Optimized
_.isEmpty
for objects - Fixed argument order of
fp/assign
,fp/defaults
, &fp/merge
- Added
_.matches
to the core build - Added placeholder support to “fp” methods
- Added support for keycap emojis
- Ensured
_.concat
returns an empty array for nullish values - Ensured
_.each
&_.eachRight
aliases have the correct chain behavior - Ensured
_.defaultsDeep
doesn’t convert function properties to objects - Ensured
_.fromPairs
can consume results of_.toPairs
- Ensured
_.isEqual
compares objects unordered - Ensured
_.noConflict
restores_
only iflodash
is the current value - Ensured
_.words
captures all-caps words - Ensured
_.words
treats all-lower & all-upper postfixes as separate words - Fixed “fp” mapping of several methods
- Made
_.omitBy
&_.pickBy
provide akey
param to iteratees
-
Removed Bower & Component package support in favor of npm
-
Dropped IE 6-8 support
- Made
_#times
,_#forEach
,_#forIn
,_#forOwn
, & their right-forms implicitly end chain sequences
var wrapped = _([1, 2, 3]);
// in 3.10.1
wrapped.forEach(function(n) { console.log(n); });
// ➜ returns the lodash wrapper without logging until `value` is called
wrapped.forEach(function(n) { console.log(n); }).value();
// ➜ logs each value from left to right and returns the array
// in 4.0.0
wrapped.forEach(function(n) { console.log(n); });
// ➜ logs each value from left to right and returns the array
- Removed category names from module paths
// in 3.10.1
var chunk = require('lodash/array/chunk');
// in 4.0.0
var chunk = require('lodash/chunk');
- Removed
_.pluck
in favor of_.map
with iteratee shorthand
var objects = [{ 'a': 1 }, { 'a': 2 }];
// in 3.10.1
_.pluck(objects, 'a'); // ➜ [1, 2]
_.map(objects, 'a'); // ➜ [1, 2]
// in 4.0.0
_.map(objects, 'a'); // ➜ [1, 2]
- Removed
thisArg
params from most methods because they were largely unused, complicated implementations, & can be tackled with_.bind
,Function#bind
, or arrow functions
var objects = [{ 'a': 1 }, { 'a': 2 }];
var context = { 'b': 5 };
function callback(item) {
return item.a + this.b;
}
// in 3.10.1
_.map(objects, callback, context);
// in 4.0.0
_.map(objects, _.bind(callback, context));
var array = [1, 2, 3],
objects = [{ 'a': 1 }, { 'a': 2 }];
// in 3.10.1
_.max(array); // ➜ 3
_.max(objects, 'a'); // ➜ { 'a': 2 }
_.min(array); // ➜ 1
_.min(objects, 'a'); // ➜ { 'a': 1 }
// in 4.0.0
_.max(array); // ➜ 3
_.maxBy(objects, 'a'); // ➜ { 'a': 2 }
_.min(array); // ➜ 1
_.minBy(objects, 'a'); // ➜ { 'a': 1 }
- Method removals
- Removed
_.support
- Removed
_.findWhere
in favor of_.find
with iteratee shorthand - Removed
_.where
in favor of_.filter
with iteratee shorthand - Removed
_.pluck
in favor of_.map
with iteratee shorthand
- Removed
- Method renames
- Renamed
_.first
to_.head
- Renamed
_.indexBy
to_.keyBy
- Renamed
_.invoke
to_.invokeMap
- Renamed
_.modArgs
to_.overArgs
- Renamed
_.padLeft
&_.padRight
to_.padStart
&_.padEnd
- Renamed
_.pairs
to_.toPairs
- Renamed
_.rest
to_.tail
- Renamed
_.restParam
to_.rest
- Renamed
_.sortByOrder
to_.orderBy
- Renamed
_.trimLeft
&_.trimRight
to_.trimStart
&_.trimEnd
- Renamed
_.trunc
to_.truncate
- Renamed
- Split out methods
- Split
_.assign
&_.assignIn
into_.assignWith
&_.assignInWith
- Split
_.clone
&_.cloneDeep
into_.cloneWith
&_.cloneDeepWith
- Split
_.indexOf
&_.lastIndexOf
into_.sortedIndexOf
&_.sortedLastIndexOf
- Split
_.invert
into_.invertBy
(see v4.1.0) - Split
_.isEqual
into_.isEqualWith
- Split
_.isMatch
into_.isMatchWith
- Split
_.max
&_.min
into_.maxBy
&_.minBy
- Split
_.merge
into_.mergeWith
- Split
_.omit
&_.pick
into_.omitBy
&_.pickBy
- Split
_.sample
into_.sampleSize
- Split
_.sortedIndex
into_.sortedIndexBy
- Split
_.sortedLastIndex
into_.sortedLastIndexBy
- Split
_.sum
into_.sumBy
- Split
_.uniq
into_.sortedUniq
,_.sortedUniqBy
, &_.uniqBy
- Split
_.zipObject
into_.fromPairs
- Split
- Absorbed
_.sortByAll
into_.sortBy
- Changed the category of
_.at
to “Object” - Changed the category of
_.bindAll
to “Util” - Changed
_.matchesProperty
shorthand to an array of[path, srcValue]
- Enabled
_.merge
to assignundefined
if the destination property doesn’t exist - Made “By” methods like
_.groupBy
&_.sortBy
provide a single param to iteratees - Made
_.add
,_.max
,_.min
, &_.sum
no longer coerce values to numbers - Made
_.capitalize
uppercase the first character & lowercase the rest (see _.upperFirst) - Made
_.eq
its own method instead of an alias for_.isEqual
- Made
_.functions
return only own method names - Made
_.max
&_.min
returnundefined
when passed an empty array - Made
_.words
chainable by default - Moved
./lodash.js
to./dist/lodash.js
in themaster
branch - Moved
./index.js
to./lodash.js
in thenpm
branch - Removed
isDeep
params from_.clone
&_.flatten
- Removed
multiValue
param from_.invert
- Removed support for binding all methods by default from
_.bindAll
- Removed
func
-first param signature from_.before
&_.after
- Dropped boolean
options
param support in_.debounce
,_.mixin
, &_.throttle
- Dropped support for boolean
orders
param in_.orderBy
- Made
_.escapeRegExp
align to the defunct ES7 proposal - Made
_.max
,_.min
, &_.sum
support arrays only - Removed legacy
options
param signature from_.template
- Core build
- 4 kB (gzipped) core build (64 methods; Backbone ≥ v1.3.0 compatible)
_.assignIn
,_.before
,_.bind
,_.chain
,_.clone
,_.compact
,_.concat
,_.create
,_.defaults
,_.defer
,_.delay
,_.each
,_.escape
,_.every
,_.filter
,_.find
,_.first
,_.flatten
,_.flattenDeep
,_.forEach
,_.has
,_.head
,_.identity
,_.indexOf
,_.isArguments
,_.isArray
,_.isBoolean
,_.isDate
,_.isEmpty
,_.isEqual
,_.isFinite
,_.isFunction
,_.isNaN
,_.isNull
,_.isNumber
,_.isObject
,_.isRegExp
,_.isString
,_.isUndefined
,_.iteratee
,_.keys
,_.last
,_.map
,_.matches
,_max
,_.min
,_.mixin
,_.negate
,_.noConflict
,_.noop
,_.once
,_.pick
,_.reduce
,_.result
,_.size
,_.slice
,_.some
,_.sortBy
,_.tap
,_.thru
,_.toArray
,_.uniqueId
,_#value
, &_.values
- Reduced functionality:
- Cloning only supports arrays &
Object
objects - Iteratee shorthand for
_.matchesProperty
is removed - Lazy evaluation is removed
- Placeholder support is removed
- Support for deep property paths is removed
- Support for maps, sets, & typed arrays is removed
- Cloning only supports arrays &
- Added 80 methods
-
22 array methods:
_.concat, _.differenceBy, _.differenceWith, _.fromPairs, _.intersectionBy, _.intersectionWith, _.join, _.pullAll, _.pullAllBy, _.reverse, _.sortedIndexBy, _.sortedIndexOf, _.sortedLastIndexBy, _.sortedLastIndexOf, _.sortedUniq, _.sortedUniqBy, _.unionBy, _.unionWith, _.uniqBy, _.uniqWith, _.xorBy, & _.xorWith -
18 lang methods:
_.cloneDeepWith, _.cloneWith, _.eq, _.isArrayLike, _.isArrayLikeObject, _.isEqualWith, _.isInteger, _.isLength, _.isMatchWith, _.isNil, _.isObjectLike, _.isSafeInteger, _.isSymbol, _.toInteger, _.toLength, _.toNumber, _.toSafeInteger, & _.toString -
13 object methods:
_.assignIn, _.assignInWith, _.assignWith, _.functionsIn, _.hasIn, _.invoke, _.mergeWith, _.omitBy, _.pickBy, _.setWith, _.toPairs, _.toPairsIn, & _.unset -
8 string methods:
_.lowerCase, _.lowerFirst, _.replace, _.split, _.upperCase, _.upperFirst, _.toLower, & _.toUpper -
8 utility methods:
_.cond, _.conforms, _.nthArg, _.over, _.overEvery, _.overSome, _.rangeRight, & _.toPath -
2 collection methods:
_.flatMap (see v4.2.0) & _.sampleSize -
2 number methods:
_.clamp & _.subtract -
1 chain method:
_#next
- Added 3 aliases
- Added
_.extend
as an alias of_.assignIn
- Added
_.extendWith
as an alias of_.assignInWith
- Added
_.first
as an alias of_.head
- Removed 17 aliases
- Removed
_.all
in favor of_.every
- Removed
_.any
in favor of_.some
- Removed
_.backflow
in favor of_.flowRight
- Removed
_.callback
in favor of_.iteratee
- Removed
_.collect
in favor of_.map
- Removed
_.compose
in favor of_.flowRight
- Removed
_.contains
in favor of_.includes
- Removed
_.detect
in favor of_.find
- Removed
_.foldl
in favor of_.reduce
- Removed
_.foldr
in favor of_.reduceRight
- Removed
_.include
in favor of_.includes
- Removed
_.inject
in favor of_.reduce
- Removed
_.methods
in favor of_.functions
- Removed
_.object
in favor of_.fromPairs
or_.zipObject
- Removed
_#run
in favor of_#value
- Removed
_.select
in favor of_.filter
- Removed
_.unique
in favor of_.uniq
instead
- Performance improvements
- Enabled shortcut fusion for
_.at
,_.find
&_.findLast
- Optimized match methods to avoid deep crawling if
object
&source
identical - Optimized circular reference searches
- Optimized
_.isEqual
to avoid stack crawls when arrays or objects are different sizes
- Emoji support
- Added support for astral symbols, combining diacritical marks, dingbats, regional indicator symbols, unicode modifiers, variation selectors, & zero-width-joiners to string methods
- Functional goodies
- Added _.cond, _.conforms, _.flip, _.nthArg, _.over, _.overEvery, _.overSome, & _.unary
- Moved
lodash-fp
intolodash
asrequire('lodash/fp')
for immutable auto-curried iteratee-first data-last methods
- Added
clear
method to_.memoize.Cache
- Added
flush
method to debounced & throttled functions - Added support for maps, sets, & symbols to
_.clone
,_.isEqual
, &_.toArray
- Added support for array buffers to
_.isEqual
- Added support for converting iterators to
_.toArray
- Added support for deep paths to
_.zipObject
- Changed UMD to export to
window
orself
when available regardless of other exports - Enabled
_.flow
&_.flowRight
to accept an array of functions - Ensured “Collection” methods treat functions as objects
- Ensured debounce
cancel
clearsargs
&thisArg
references - Ensured
_.add
&_.sum
don’t skipNaN
values - Ensured
_.assign
,_.defaults
, &_.merge
coerceobject
values to objects - Ensured
_.bindKey
bound functions callobject[key]
when called with thenew
operator - Ensured
_.clone
treats generators like functions - Ensured
_.clone
produces clones with the source’s[[Prototype]]
- Ensured
_.defaults
assigns properties that shadowObject.prototype
- Ensured
_.defaultsDeep
doesn’t merge a string into an array - Ensured
_.defaultsDeep
&_.merge
don’t modify sources - Ensured
_.defaultsDeep
works with circular references - Ensured
_.isFunction
returnstrue
for generator functions - Ensured
_.keys
skips “length” on strict modearguments
objects in Safari 9 - Ensured
_.merge
assigns typed arrays directly - Ensured
_.merge
doesn’t convert strings to arrays - Ensured
_.merge
merges plain-objects onto non plain-objects - Ensured
_#plant
resets iterator data of cloned sequences - Ensured
_.random
swapsmin
&max
ifmin
is greater thanmax
- Ensured
_.range
preserves the sign ofstart
of-0
- Ensured
_.reduce
&_.reduceRight
usegetIteratee
in their array branch - Fixed rounding issue with the
precision
param of_.floor
- Made
_(...)
an iterator & iterable - Made
_.drop
,_.take
, & right forms coercen
ofundefined
to0
- Ensured
func
is a function before callinggetData
- Ensured
_.clone
provides the correct number of arguments tocustomizer
- Ensured
_#reverse
doesn’t modify the original array when called after_#slice
- Added
_.ceil
,_.defaultsDeep
,_.floor
,_.modArgs
, &_.round
- Ensured
_.bind
works with all built-in constructors - Ensured
_#concat
treats sparse arrays as dense - Ensured
_.chunk
floorssize
values - Ensured
_.debounce
&_.throttle
resetlastCall
after cancelling - Ensure
_.flow
&_.flowRight
work with functions combined with_.first
- Ensured
_.indexOf
returns-1
for unmatched binary searches - Ensured
_.noConflict
operates onroot
& notcontext
- Made
_.escapeRegExp
more robust - Made
_.sortByOrder
support orders of “asc” & “desc” - Optimized
_.flatten
,_.max
, &_.min
- Removed fallbacks for
_.isArguments
,_.isFunction
, &_.isPlainObject
- Simplified lazy evaluation support
- Simplified
_.isElement
,_.isFinite
,_.isNative
,_.now
,_.parseInt
, &_.sum
- Made
parseFloat
assigned from thecontext
param of_.runInContext
- Ensured
_.set
handles non-index property names that start with numbers correctly
- Made
isLaziable
work with wrapped lodash methods - Optimized an early exit case in
_.isEqual
- Optimized
_.sample
- Added
_.gt
,_.gte
,_.lt
, &_.lte
- Added support for an
ImmutableMap
to_.memoize.Cache
- Avoided using
require
in source comments to improve browserify build times - Ensured
baseCreate
works in ExtendScript - Ensured
customizer
results are respected by_.isEqual
- Ensured
LodashWrapper.prototype.thru
exists before creating a wrapper inflow
- Ensured
_.bind
works with ES2015 class constructors - Ensured
_.get
can returnnull
values - Ensured
_.intersection
works with a single array - Ensured
_.has
treats sparse arrays as dense - Ensured
_.merge
skipsundefined
array values if a destination value exists - Made
null
sort behindundefined
&NaN
- Made
_.eq
an alias of_.isEqual
- Optimized object comparisons in
_.isEqual
- Optimized
_.max
&_.min
when invoked with iteratees - Optimized
_.pullAt
&_.remove
- Used
hasOwnProperty
for the creation ofreIsNative
to avoid issues with core-js
- Added
_.mapKeys
,_.unzipWith
, &_.zipWith
- Made
_.difference
,_.intersection
,_.uniq
, &_.xor
accept array-like values - Ensured empty brackets are ignored by
_.get
&_.set
- Ensured
baseAt
,basePullAt
, &pullAt
handle nullish values - Ensured
baseGet
only returnsundefined
for incomplete paths - Ensured
_.padLeft
&_.padRight
handle empty strings correctly - Made
_.isEqual
treat-0
&0
as equivalent - Narrowed bitmask checks in
_.flow
&_.flowRight
- Optimized lazy
slice
forstart
of0
- Optimized “flatten” methods
- Restricted
Object.assign
use to strict mode only
- Added
_.get
,_.method
,_.methodOf
, &_.set
- Avoided a JIT bug in Safari on at least iOS 8.1-8.3 ARM64
- Ensured
_.intersection
of a single array returns an empty array - Ensured
_.remove
mutatesarray
after thepredicate
pass - Ensured methods like
_.has
&_.get
can access index values of strings - Made
createAssigner
&_.sortByAll
use_.restParam
- Made
_.add
coerceaugend
&addend
params to numbers - Made
_.assign
use built-inObject.assign
when available - Made
_.inRange
swapstart
&end
params whenstart
is greater thanend
- Added deep path support to methods like
_.has
,_.get
,_.callback
,_.invoke
,_.matchesProperty
,_.method
,_.methodOf
,_.property
,_.propertyOf
,_.result
, &_.set
- Added
_.restParam
- Added
isIterateeCall
guards to_.every
,_.includes
, &_.some
- Added support for
iteratee
&thisArg
params to_.sum
- Added support for shortcut fusion optimizations to
_.flow
&_.flowRight
- Ensured lodash bundled by r.js runs in a web worker
- Ensured
_.deburr
removes combining diacritical marks - Ensured
_.difference
is based on the values of the first param only - Expanded metadata optimizations to more combinations of curried functions
- Made
_.matches
work with non-plain objects & match inherited properties - Optimized
_.findLast
,_.reduce
, &_.reduceRight
- Reduced code duplication with internal method creator functions
- Added string
replace
&split
chaining methods - Ensured lazy
drop
works when applied afterfilter
- Optimized curried method performance
- Added
_.add
,_.sortByOrder
, &_.sum
- Adjusted
root
to work when bundled by webpack & running in a web worker - Ensured lazy chaining works with combinations of
drop
&dropWhile
- Ensured
_.defaults
works as an iteratee for_.reduce
- Reduced side effects of shortcut fusion
- Optimized
baseFlatten
,baseIndexOf
,indexOfNaN
,_.flow
, &_.flowRight
- Optimized lazy evaluation for iteratees with one param
- Ensured lazy
takeWhile
works with lazyreverse
&last
- Ensured
wait
defaults to0
for_.debounce
&_.throttle
- Ensured
isIterateeCall
doesn’t error ifindex
is missing atoString
method - Optimized
_.difference
,_.intersection
, &_.uniq
in Firefox
- Added
_.inRange
- Added links to each method’s npm package to the documentation
- Enabled
_.clone
to work with more truthyisDeep
values - Ensured each lodash wrapper module sets up their inheritance
- Ensured
isIterateeCall
works withNaN
values - Ensured
_.merge
avoids iterating stringobject
orsource
params - Optimized
_.attempt
- Reduced nested dependencies of
_.template
- Added
_.fill
,_.matchesProperty
, &_.spread
- Added
_#commit
&_#plant
- Added support for lazy
_.compact
&_.toArray
- Enabled
_.attempt
to provide additional arguments tofunc
- Ensured
_.flow
returns an identity function when called without arguments - Ensured
_#reverse
tracks__chain__
values - Ensured lazy
_.slice
handles floating-pointstart
&end
params - Fixed lazy
_.slice
when used after_.filter
- Made
_#run
an alias of_#value
- Added
_.startCase
- Ensured
isIterateeCall
works correctly with objects
- Ensured
_.slice
coerces floating-pointstart
&end
params to integers - Fixed lazy
initial
,rest
, &reverse
- Fixed
_.merge
regression with DOM elements
- Made chaining lazy, that is, execution is deferred until
_#value
is implicitly or explicitly called
var wrapped = _([1, 2, 3]);
// in 2.4.1
wrapped.forEach(function(n) { console.log(n); });
// ➜ logs each value from left to right and returns the lodash wrapper
// in 3.0.0
wrapped.forEach(function(n) { console.log(n); });
// ➜ returns the lodash wrapper without logging until `value` is called
wrapped.forEach(function(n) { console.log(n); }).value();
// ➜ logs each value from left to right and returns the array
- Ensured each segment of a chain sequence may be repeatly applied
var array = [1],
wrapped = _(array);
// in 2.4.1
var a = wrapped.push(2), // pushes `2` to `array`
b = wrapped.push(3); // pushes `3` to `array`
a.value(); // ➜ returns `array`; [1, 2, 3]
b.value(); // ➜ returns `array`; [1, 2, 3]
// in 3.0.0
var a = wrapped.push(2), // creates a lazy sequence to push `2` to `array`
b = wrapped.push(3); // creates a lazy sequence to push `3` to `array`
a.value(); // ➜ pushes `2` to `array` and returns `array`; [1, 2]
b.value(); // ➜ pushes `3` to `array` and returns `array`; [1, 2, 3]
a.value(); // ➜ pushes `2` to `array` and returns `array`; [1, 2, 3, 2]
b.value(); // ➜ pushes `3` to `array` and returns `array`; [1, 2, 3, 2, 3]
// use `_#commit` to commit a sequence and continue chaining
var a = wrapped.push(2).commit(), // pushes `2` to `array`
b = wrapped.push(3).commit(); // pushes `3` to `array`
a.value(); // ➜ returns `array`; [1, 2, 3]
b.value(); // ➜ returns `array`; [1, 2, 3]
- Made
_.flatten
shallow by default & removecallback
support
var array = [1, [[2], 3]],
objects = [{ 'a': [1] }, { 'a': [2, 3] }];
// in 2.4.1
_.flatten(array); // ➜ [1, 2, 3]
_.flatten(objects, 'a'); // [1, 2, 3]
// in 3.0.0
_.flatten(array); // ➜ [1, [2], 3]
_.flattenDeep(array); // ➜ [1, 2, 3]
_(objects).pluck('a').flatten().value(); // [1, 2, 3]
- Removed the
data
parameter from_.template
var string = '<%= o.a %>',
options = { 'variable': 'o' },
data = { 'a': 'b' };
// in 2.4.1
_.template(string, data, options); // ➜ 'b'
// in 3.0.0
_.template(string, options)(data); // ➜ 'b'
- Split
_.first
&_.last
into_.take
,_.takeWhile
,_.takeRight
, &_.takeRightWhile
var array = [1, 2, 3],
lessThanTwo = function(value) { return value < 2; },
greaterThanTwo = function(value) { return value > 2; };
// in 2.4.1
_.first(array); // ➜ 1
_.first(array, 2); // ➜ [1, 2]
_.first(array, lessThanTwo); // ➜ [1]
_.last(array); // ➜ 3
_.last(array, 2); // ➜ [2, 3]
_.last(array, greaterThanTwo); // ➜ [3]
// in 3.0.0
_.first(array); // ➜ 1
_.take(array, 2); // ➜ [1, 2]
_.takeWhile(array, lessThanTwo); // ➜ [1]
_.last(array); // ➜ 3
_.takeRight(array, 2); // ➜ [2, 3]
_.takeRightWhile(array, greaterThanTwo); // ➜ [3]
- Split
_.initial
&_.rest
into_.dropRight
,_.dropRightWhile
,_.drop
, &_.dropWhile
var array = [1, 2, 3],
lessThanTwo = function(value) { return value < 2; },
greaterThanTwo = function(value) { return value > 2; };
// in 2.4.1
_.initial(array); // ➜ [1, 2]
_.initial(array, 2); // ➜ [1]
_.initial(array, greaterThanTwo); // ➜ [1, 2]
_.rest(array); // ➜ [2, 3]
_.rest(array, 2); // ➜ [3]
_.rest(array, lessThanTwo); // ➜ [2, 3]
// in 3.0.0
_.initial(array); // ➜ [1, 2]
_.dropRight(array, 2); // ➜ [1]
_.dropRightWhile(array, greaterThanTwo); // ➜ [1, 2]
_.rest(array); // ➜ [2, 3]
_.drop(array, 2); // ➜ [3]
_.dropWhile(array, lessThanTwo); // ➜ [2, 3]
- Aligned
_.isFinite
&_.keys
with ES2015 - Changed the category of
_.clone
&_.cloneDeep
, & “isType” methods from “Object” to “Lang” - Changed the category of
_.escape
,_.template
, &_.unescape
from “Util” to “String” - Changed the category of
_.range
from “Array” to “Util” - Changed the category of
_.toArray
from “Collection” to “Lang” - Made method categories singular
- Made “Object” methods coerce primitives to objects
- Made
_.clone
&_.cloneDeep
return a new object for unsupported types - Made
_.findWhere
its own method instead of an alias for_.find
- Made
_.max
&_.min
non-chainable by default - Made
_.memoize
caches have theMap
interface ofdelete
,get
,has
, &set
- Made
_.unzip
its own method instead of an alias for_.zip
- Moved
./dist/lodash.js
to./lodash.js
in themaster
branch - Moved
./dist/lodash.js
to./lodash.js
in thenpm
branch - Moved
./dist/lodash.compat.js
to thelodash/lodash-compat
repository - Moved support for sorting by multiple properties from
_.sortBy
to_.sortByAll
- Removed result sorting from
_.functions
- Removed the
underscore
build - Renamed
_.createCallback
to_.callback
- Renamed
_.support.argsClass
to_.support.argsTag
- Renamed
_.support.nodeClass
to_.support.nodeTag
- Restricted
_.mixin
to iterating only own properties ofsource
objects - Expanded the number of arguments provided to
customizer
callbacks of_.assign
,
_.clone
,_.cloneDeep
,_.isEqual
, &_.merge
- Added customizable argument placeholder support to
_.bind
,_.bindKey
,_.curry
,_.curryRight
,_.partial
, &_.partialRight
- Added support for matching
NaN
to_.difference
,_.includes
,_.indexOf
,_.intersection
,_.lastIndexOf
,_.union
,_.uniq
, &_.xor
- Ensured
_.assign
&_.merge
don’t assigncustomizer
results if it’s unchanged - Ensured
_.mixin
doesn’t extend lodash when given an emptyoptions
object - Ensured
_.sortedIndex
returns values that align with the sort order of_.sortBy
- Ensured functions of
_.matches
returntrue
when comparing empty sources - Ensured functions of
_.matches
perform own property checks on objects - Made
_.chain
use an existing wrapper if available instead of creating a new wrapper - Removed the
argCount
parameter from_.callback
- Added 47 methods
-
17 string methods:
_.camelCase
,_.capitalize
,_.deburr
,_.endsWith
,_.escapeRegExp
,_.kebabCase
,_.pad
,_.padLeft
,_.padRight
,_.repeat
,_.snakeCase
,_.startsWith
,_.trim
,_.trimLeft
,_.trimRight
,_.trunc
, &_.words
-
11 array methods:
_.chunk
,_.dropRight
,_.dropRightWhile
,_.dropWhile
,_.flattenDeep
,_.pullAt
,_.slice
,_.sortedLastIndex
,_.takeRight
,_.takeRightWhile
, &_.takeWhile
-
6 function methods:
_.ary
,_.before
,_.curryRight
,_.flow
,_.negate
, &_.rearg
-
5 lang methods:
_.isError
,_.isMatch
,_.isNative
,_.isTypedArray
, &_.toPlainObject
-
3 utility methods:
_.attempt
,_.matches
, &_.propertyOf
-
2 collection methods:
_.partition
&_.sortByAll
-
2 object methods:
_.keysIn
&_.valuesIn
-
1 chain method:
_.thru
- Added 5 aliases
- Added
_.backflow
&_.compose
as aliases of_.flowRight
- Added
_.contains
as an alias of_.includes
- Added
_.iteratee
as an alias of_.callback
- Added
_#toJSON
as an alias of_#valueOf
- Performance improvements
- Improved overall performance 20-40%
- Method chaining supports lazy evaluation
- Methods with support for shortcut fusion:
_.drop
,_.dropRight
,_.dropRightWhile
,_.dropWhile
,_.filter
,_.first
,_.initial
,_.last
,_.map
,_.pluck
,_.reject
,_.rest
,_.reverse
,_.slice
,_.take
,_.takeRight
,_.takeRightWhile
,_.takeWhile
, &_.where
- Other optimized methods:
_.bind
,_.clone
,_.cloneDeep
,_.compact
,_.compose
,_.contains
,_.difference
,_.escape
,_.flatten
,_.invoke
,_.isEqual
,_.isObject
,_.matches
,_.max
,_.min
,_.partial
,_.shuffle
,_.unescape
,_.uniq
,_.without
, &_.zip
- Functional goodies
- Added
_.ary
,_.curryRight
,_.flow
, &_.rearg
- Added placeholder support to
_.bind
,_.bindKey
,_.curry
,_.curryRight
,_.partial
, &_.partialRight
- Methods that work as an iteratee for
_.map
, & the like, out of the box:
_.ary
,_.callback
,_.chunk
,_.clone
,_.create
,_.curry
,_.curryRight
,_.drop
,_.dropRight
,_.flatten
,_.invert
,_.max
,_.min
,_.parseInt
,_.slice
,_.sortBy
,_.take
,_.takeRight
,_.template
,_.trim
,_.trimLeft
,_.trimRight
,_.trunc
,_.random
,_.range
,_.sample
,_.uniq
, &_.words
- Methods that work as an iteratee for
_.reduce
, & the like, out of the box:
_.assign
,_.defaults
,_.merge
, &_.sortAllBy
- Added cherry pickable method modules to the npm package
- Added
cancel
method to debounced & throttled functions - Added
defaultValue
param to_.result
- Added
multiValue
param to_.invert
- Added
thisArg
param to_.tap
- Added
_.memoize.Cache
to enableMap
/WeakMap
to be used - Added support for cloning array buffers & typed arrays to
_.clone
&_.cloneDeep
- Added support for comparing error objects & typed arrays to
_.isEqual
- Enabled the
sourceURL
option of_.template
to work in production builds - Ensured
_.at
,_.matches
, &_.pullAt
work with falsey values when keys are given - Ensured
_.callback
doesn’t error whenfunc
is nullish &thisArg
is given - Ensured
_.callback
supports binding built-in methods - Ensured
_.debounce
&_.throttle
work if the system time is set backwards - Ensured
_.difference
works with arrays regardless of argument position - Ensured
_.findWhere
&_.where
always use_.matches
- Ensured
_.includes
supportsfromIndex
when iterating objects - Ensured
_.indexOf([], undefined, true)
returns-1
instead of0
- Ensured
_.intersection
ignores non-array secondary values - Ensured
_.isEqual
works with wrapped objects containingconstructor
properties - Ensured
_.keys
treats sparse arrays as dense - Ensured
_.keys
works with string objects in IE < 9 - Ensured
_.matches
comparison isn’t affected by changes tosource
objects - Ensured
_.max
&_.min
return the correct value whencallback
computes ±Infinity - Ensured
_.merge
ignoresundefined
values ofsource
object properties - Ensured
_.partial
&_.partialRight
work with curried functions - Ensured
_.pluck
always uses_.property
- Ensured
_.random
returns1
or0
when called with no arguments - Ensured
_.range
,_.slice
, & other methods handleNaN
arguments - Ensured
_.runInContext
uses a zeroed_.uniqueId
counter - Ensured
_.transform
checks thatobject
is an object before using its[[Prototype]]
- Ensured
_.where
handlessource
objects withundefined
property values - Ensured
_.where
only returns elements that contain all source array/object values - Ensured browserified lodash works in web workers
- Ensured customizing
_.indexOf
affects_.includes
when iterating objects - Ensured lodash works in
NW.js
- Ensured lodash doesn’t add
Function.prototype
extensions to its prototype - Fixed
_.isFunction
for typed array constructors in Safari 8 - Made
_.escape
&_.unescape
handle backticks - Made
_.isElement
more robust - Made
_.parseInt
more closely follow spec - Made
_.wrap
use_.identity
whenwrapper
is nullish - Made templates avoid referencing
_.escape
if “escape” delimiters are not used - Made array-like object checks follow ES2015
ToLength
- Made use of
Set
in_.difference
,_.intersection
, &_.uniq
- Removed array & object pools
- Removed all method compilation from the
compat
build - Updated the sourceURL syntax used by
_.template
- Avoided memory leaks in
_.bind
,_.bindKey
,_.curry
,_.partial
, &_.partialRight
- Ensured
__bindData__
is properly cloned - Ensured
_.isEqual
can compare cyclical objects with shared property values - Optimized
_.partial
&_.partialRight
- Reached ~100% code coverage
- Added
_.constant
,_.mapValues
,_.now
,_.property
, &_.xor
- Added an
options
param to_.mixin
to specify whether functions added are chainable - Added support for
_.sortBy
to accept an array of property names to sort by - Enabled
_.zipObject
to accept an array ofkeys
with novalues
param - Removed conditional
setImmediate
use from_.defer
- Added
_.create
&_.noop
- Avoided memory leaks in
_.debounce
&_.throttle
- Enhanced
_.createCallback
to avoid binding functions bound byFunction#bind
- Ensured rebound functions correctly partially apply arguments
- Ensured
_.isEqual
works with values fromObject.create(null)
&_(false)
- Ensured
_.min
&_.max
work as callbacks for_.map
- Ensured
_.template
coerces thetext
param to a string - Optimized
_.difference
,_.omit
, &_.without
by way ofbaseDifference
- Optimized
_.isBoolean
,_.isNumber
, &_.isString
for thefalse
case - Optimized
_.sample
&_.shuffle
by way ofbaseRandom
- Reduced
_.wrap
by way ofcreateBound
- Removed native
Function#bind
use for better_.bind
cross-environment consistency
- Ensured
_.mixin
creates functions that work with_.chain
- Ensured the the
createObject
fallback is included in themodern
build
- Added
_.clone
support for date, regexp, & other built-in objects - Ensured
_.random
avoids excessive results of0
for floating-point numbers - Made
compat
&underscore
builds useDate.now
when available - Reduced dependencies on
getObject
&releaseObject
- Added
Object.defineProperty
fallback for themodern
build - Added support to
_.random
to explicitly specify floating point numbers - Enabled
_.compose
to be invoked without arguments - Ensured
_.flatten
works with extremely large arrays - Ensured
_.support
properties aren’t minified - Ensured
reThis
isn’t used in Windows 8 applications - Made UMD more resistant to false positives
- Optimized
_.isArguments
&_.isArray
fallbacks
- Aligned
_.after
with Underscore 1.5.0, making it always return a function - Made
_.unzip
an alias of_.zip
- Created lodash methods as npm packages & AMD/Node.js modules
- Made
_.chain
force chaining for all methods - Moved the build utility to
lodash-cli
- Optimized
_.contains
,_.debounce
,_.isArguments
,_.throttle
, &_.where
- Optimized functions of
_.bind
,_.bindKey
,_.curry
,_.partial
, &_.partialRight
- Added
_.curry
,_.forEachRight
,_.indexBy
,_.findLast
,_.findLastIndex
,_.findLastKey
,_.forInRight
,_.forOwnRight
,_.pull
,_.remove
, &_.sample
- Added Curl & Dojo module loaders to the unit tests
- Added the
modularize
build option - Added support for the
iife
command to be used without an%output%
token - Added support for
_.mixin
to accept a destination object - Added support for
_.range
to accept astep
of0
- Ensured “Array” methods support
arguments
objects - Ensured “Function” methods throw on non-functions
- Ensured
_.at
works as a callback for_.map
- Ensured
_.createCallback
works when noargCount
is specified - Ensured
_.first
&_.last
return arrays when given ann
with a falseyarray
- Ensured
_.flatten
works witharguments
objects - Ensured minified files work with Dojo’s builder
- Ensured
_.zipObject
skips falsey elements - Improved dead code removal from builds
- Improved JSDoc syntax
- Made
_.eachRight
an alias of_.forEachRight
- Made
_.memoize
avoid prefixingcache
keys when using aresolver
function - Removed local
clearTimeout
&setTimeout
variables from theunderscore
build - Reduced the size of the repo & npm package
- Simplified the bailout in
createCache
- Updated sourceURL & sourceMappingURL syntax
- Updated
underscore
build compatibility to v1.5.2
- Added missing
cache
property to the objects returned bygetObject
- Ensured
maxWait
unit tests pass in Ringo - Increased the
maxPoolSize
value - Optimized
releaseArray
&releaseObject
- Added
_.transform
- Added
_.chain
&_.findWhere
aliases - Added internal array & object pooling
- Added Istanbul test coverage reports to Travis CI
- Added
maxWait
option to_.debounce
- Added support for floating point numbers to
_.random
- Added Volo configuration to package.json
- Adjusted UMD for
component build
- Enabled more stable mixing of
lodash
&underscore
build methods - Ensured debounced function with
leading
&trailing
options works as expected - Ensured minified builds work with the Dojo builder
- Ensured minification avoids deoptimizing expressions containing boolean values
- Ensured support for
--output
paths containing build command keywords - Ensured unknown types return
false
in_.isObject
&_.isRegExp
- Ensured
_.clone
,_.flatten
, &_.uniq
can be used as callback for_.map
- Ensured
_.forIn
works on objects with longer inheritance chains in IE < 9 - Ensured
_.isPlainObject
returnstrue
for empty objects in IE < 9 - Ensured
_.max
&_.min
chain correctly - Ensured
clearTimeout
use doesn’t cause errors in Titanium - Ensured that the
--stdout
build option doesn’t write to a file - Exposed memoized function’s
cache
- Fixed
Error.prototype
iteration bugs - Fixed “scripts” paths in component.json
- Made methods support customizing
_.indexOf
- Made the build track dependencies of private functions
- Made the
template
pre-compiler build option avoid escaping non-ascii characters - Made
_.createCallback
avoid binding functions if they don’t referencethis
- Optimized the Closure Compiler minification process
- Optimized the large array cache for
_.difference
,_.intersection
, &_.uniq
- Optimized internal
_.flatten
&_.indexOf
use - Reduced
_.unzip
&_.zip
- Removed special handling of arrays in
_.assign
&_.defaults
- Added Component package support
- Updated the build utility to work with changes in GitHub’s API
- Ensured
_.isPlainObject
works with objects created byObject.create(null)
- Ensured “isType” methods return
false
for subclassed values - Ensured debounced functions, with
leading
&trailing
calls enabled, only perform trailing calls after they’re called more than once
- Added
_.unzip
- Added an
options
param to_.debounce
&_.throttle
- Enabled non-
underscore
builds to include_.findWhere
&_.chain
- Ensured “Array” & “Object” methods work with
arguments
objects & arrays respectively - Ensured build utility runs on Windows
- Ensured
underscore
build versions of “isType” methods align with Underscore - Ensured methods avoid issues with the
__proto__
property - Ensured
_.isEqual
uses acallback
only if it’s a function - Ensured
_.merge
applies acallback
to nested properties - Ensured
_.merge
provides the correctcallback
arguments when comparing objects - Made lodash work with Browserify
- Removed all method compilation from the
modern
build
- Ensured the
underscore
build of_.forEach
accepts athisArg
param - Updated vendor/tar to work with Node.js v0.10
- Added
_.createCallback
,_.findIndex
,_.findKey
,_.parseInt
, &_.runInContext
- Added
_.support
- Added
callback
&thisArg
params to_.flatten
- Added
rhino -require
support - Added CommonJS/Node.js support to precompiled templates
- Ensured the
exports
object is not a DOM element - Ensured
_.isPlainObject
returnsfalse
for objects without a[[Class]]
of “Object” - Made
callback
support in_.cloneDeep
more closely follow its documentation - Made
_.object
an alias of_.zipObject
- Made the template precompiler create missing directories of
--output
paths - Optimized method chaining, object iteration,
_.find
, &_.pluck
- Updated
backbone
build method dependencies
- Ensured
_.isPlainObject
works when built-inObject.getPrototypeOf
is unavailable
- Added support for specifying source map URLs in
-p
/--source-map
options - Ensured the second argument to
_.assign
is not treated as acallback
- Ensured
-p
/--source-map
build options correctly set thesourceMappingURL
- Made
-p
/--source-map
set source map “sources” keys based on the build - Made
_.defer
usesetImmediate
, in Node.js, when available - Made
_.where
search arrays for values regardless of their index position - Removed dead code from
_.template
- Made
_.defaults
preservenull
values, instead of overwriting them
- Added
_.at
&_.partialRight
- Added
modern
&-p
/--source-map
build options - Added “imports” option to
_.templateSettings
- Added support for
_.pluck
&_.where
callback shorthands - Ensured
_.assign
&_.defaults
support arrays - Ensured
_.merge
assignsnull
values & produces dense arrays - Deferred minifier downloads until the
lodash
utility requires them - Flipped
noNodeClass
test to avoid Firebug’s “break on all errors” feature - Made
_.where
support deep object comparisons - Optimized
_.invert
,_.pairs
, &_.values
- Reduced
_.max
,_.min
,_.pluck
,_.toArray
, &_.where
- Removed support for automatic with-statement removal from
_.template
- Simplified
createIterator
&iteratorTemplate
- Tweaked
_.uniqueId
to avoid problems with buggy minifiers - Updated
underscore
build compatibility to v1.4.4 - Added
callback
&thisArg
params to_.assign
,_.clone
,_.cloneDeep
,_.first
,_.last
,_.initial
,_.isEqual
,_.merge
, &_.rest
- Made
_#join
,_#pop
, &_#shift
wrapper methods return unwrapped values - Made “Function” methods wrapper counterparts return wrapped values
- Removed “chain” methods
- Added
_.cloneDeep
- Added
_.once
to thebackbone
build - Ensured
backbone
builds implement Underscore’s chaining behavior - Ensured the
settings=…
build option doesn’t clobber the defaultmoduleId
- Ensured lodash’s npm package works when packages aren’t globally installed
- Made compiled templates exported for AMD use the lodash module for
_
- Removed the
_.forEach
dependency from_.intersection
- Optimized
_.isArray
&_.isFunction
fallbacks as well as_.intersection
,_.isDate
,_.isRegExp
,_.reduce
,_.reduceRight
,_.union
, &_.uniq
- Specified more method chaining behaviors
- Updated
underscore
build compatibility to v1.4.3
- Added support for
arguments
objects to_.clone
- Ensured
_.clone
creates plain object clones of non-plain objects - Made
_(…)
chain automatically without needing to call_#chain
- Made
_.isEqual
equatearguments
objects to similarObject
objects
- Ensure lodash runs in the JS engine embedded in Adobe products
- Ensured
_.reduce
&_.reduceRight
provide the correctcallback
arguments - Ensured
_.throttle
nulls thetimeoutId
- Made deep
_.clone
more closely follow the structured clone algorithm - Optimized compiled templates in Firefox
- Optimized
_.forEach
,_.forOwn
,_.isNumber
, &_.isString
- Simplified
iteratorTemplate
- Renamed
_.lateBind
to_.bindKey
- Made
_.defaults
&_.extend
iterate only own properties ofsource
objects to align withObject.assign
- Added the build commands used to custom build copyright/license headers
- Added
_.assign
- Ensured the
underscore
build of_.find
returns the first match, not last - Ensured
_.defaults
,_.extends
, &_.merge
work with_.reduce
- Made lodash’s npm package installation work with more system configurations
- Made
_.extend
an alias of_.assign
- Optimized
_.contains
,_.defaults
,_.extend
, &_.filter
- Restricted
_.where
to iterate only own properties ofsource
objects - Updated
backbone
build lodash method dependencies
- Added
fromIndex
param to_.contains
- Added
moduleId
build option - Added Closure Compiler “simple” optimizations to the build process
- Added support for strings in
_.max
&_.min
- Added support for ES2015 template delimiters to
_.template
- Ensured re-minification of lodash by third parties avoids Closure Compiler bugs
- Optimized
_.every
,_.find
,_.some
, &_.uniq
- Ensured
_.every
returnsfalse
as soon as thecallback
result is falsey - Ensured
_.isFinite
returnsfalse
for non-numeric values - Removed
_.forEach
chainability in theunderscore
build - Simplified
_.union
- Added a
sourceURL
option to_.template
- Ensured
_.where
returns an empty array if given an emptyproperties
object - Expanded
_.isFinite
to returntrue
for numeric strings - Reduced
_.intersection
,_.omit
,_.pick
,_.sortedIndex
, &_.where
- Reduced the npm package size by only downloading minifiers for global installs
- Reduced lodash’s file size
- Improved source code comprehension by removing compilation from
_.bindAll
,_.contains
,_.countBy
,_.every
,_.filter
,_.find
,_.functions
,_.groupBy
,_.invert
,_.invoke
,_.isEmpty
,_.map
,_.merge
,_.omit
,_.pairs
,_.pick
,_.pluck
,_.reduce
,_.reject
,_.some
,_.sortBy
,_.values
,_.where
, & internalshimKeys
- Ensured
_.map
returns an array when given a falsey collection - Ensured
_.throttle
clears its timeout whenfunc
is called - Made
_.max
,_.min
,_.shuffle
support iterating objects - Reduced
createIterator
,_.clone
,_.compact
- Re-optimized
_.max
,_.min
, &_.sortedIndex
- Enabled deep clone support in the
underscore
build whenclone
is explicitly included - Reverted removal of first argument falsey checks from methods
- Made
_.random
return0
or1
when no arguments are given - Moved late bind functionality from
_.bind
to_.lateBind
- Removed first argument falsey checks from methods
- Removed support for custom
clone
,isEqual
,toArray
methods from_.clone
,_.isEqual
, &_.toArray
- Added
-d
/--debug
,-m/--minify
,minus
,plus
,settings
, &template
build options - Added
_.isPlainObject
&_.lateBind
- Enabled
_.sortedIndex
to accept a property name as thecallback
param - Ensured methods accept a
thisArg
ofnull
- Fixed the
iife
build option to accept more values - Made
_.times
return an array ofcallback
results - Simplified
_.max
,_.min
, &_.reduceRight
- Renamed
_.zipObject
to_.object
- Replaced
_.drop
with_.omit
- Made
_.drop
an alias of_.rest
- Added
_.invert
,_.pairs
, &_.random
- Added
_.result
to thebackbone
build - Added
exports
,iife
,-c
/--stdout
,-o
/--output
, &-s
/--silent
build options - Ensured
isPlainObject
works with objects from other documents - Ensured
_.isEqual
compares values with circular references correctly - Ensured
_.merge
work with four or more arguments - Ensured
_.sortBy
performs a stable sort forundefined
values - Ensured
_.template
works with “interpolate” delimiters containing ternary operators - Ensured the production build works in Node.js
- Ensured template delimiters are tokenized correctly
- Made pseudo private properties
_chain
&_wrapped
double-underscored to avoid conflicts - Made
minify.js
supportunderscore.js
- Reduced the size of
mobile
&underscore
builds - Simplified
_.isEqual
&_.size
- Ensured IE conditional compilation isn’t enabled by the
useSourceURL
test - Optimized
isPlainObject
- Added
callback
&thisArg
params to_.drop
&_.pick
- Added
hasObjectSpliceBug
test to avoiddelete
operator use - Added
_.unescape
- Ensured
_.reduce
works with string objects in IE < 9 - Made
_.omit
an alias of_.drop
- Made compiled methods take advantage of engines with strict mode optimizations
- Optimized
_.intersection
& removed its dependency on_.every
- Reduced the file size of the
underscore
build
- Ensured
_.isElement
uses strict equality for its duck type check - Ensured
_.isObject
returns a boolean value - Ensured
_.template
& “Object” methods don’t error when given falsey values - Made
_.template
generate less unused code in compiled templates
- Ensured
_.bind
correctly appends array arguments to partially applied arguments in older browsers
- Added
_.countBy
,_.drop
,_.merge
, &_.where
- Added
csp
(Content Security Policy) &underscore
build options - Added deep cloning support to
_.clone
- Added Jam package support
- Added support for exiting early in
_.forEach
,_.forIn
, &_.forOwn
- Added support for jQuery/MooTools DOM query collections to
_.isEmpty
&_.size
- Ensured development build works with IE conditional compilation enabled
- Ensured
_.clone
doesn’t clonearguments
objects, DOM nodes, functions, or non-plain objects - Ensured
_.filter
’scallback
can’t modify result values - Ensured
_.isEmpty
,_.isEquals
, &_.size
supportarguments
objects - Ensured
_.isEqual
doesn’t inspect DOM nodes, works with objects from other documents, & calls customisEqual
methods before checking strict equality - Ensured
_.once
frees the given function for garbage collection - Ensured
_.sortBy
performs a stable sort - Ensured
reEvaluateDelimiter
is used when_.templateSettings.evaluate
isundefined
- Made
_.range
coerce arguments to numbers - Optimized
_.isFunction
- Added
strict
build option - Ensured
_.bindAll
,_.defaults
, &_.extend
avoid strict mode errors on read-only properties - Optimized the iteration of large arrays in
_.difference
,_.intersection
, &_.without
- Fixed build bugs related to removing variables
- Fixed
_.template
regression - Optimized build process to detect & remove more unused variables
- Added
bin
&scripts
entries to package.json - Added
legacy
build option - Added cross-browser support for strings to “Collection” methods
- Added
_.zipObject
- Leveraged
_.indexOf
’sfromIndex
in_.difference
&_.without
- Optimized compiled templates
- Optimized inlining the
iteratorTemplate
for builds - Optimized object iteration for “Collection” methods
- Optimized partially applied
_.bind
in V8 - Made compiled templates more debuggable
- Made
_.size
work with falsey values & consistent cross-browser witharguments
objects - Moved
_.groupBy
&_.sortBy
back to the “Collection” category - Removed
arguments
object from_.range
- Ensured
_.escape
returns an empty string for nullish values - Ensured
sourceURL
support doesn’t cause errors in Adobe’s JS engine - Fixed regression in generating custom builds
- Moved
_.invoke
&_.pluck
back to the “Collection” category - Moved
_.tap
to the “Seq” category
- Added
backbone
build option - Ensured “Array” methods allow falsey
array
params - Removed
_.isArguments
fallback from themobile
build - Simplified
_.pluck
,_.values
&_(...)
method wrappers
- Added
_.forIn
&_.forOwn
- Added
category
build option - Added
fromIndex
param to_.indexOf
&_.lastIndexOf
- Added
//@ sourceURL
support to_.template
- Added
thisArg
param to_.sortedIndex
&_.uniq
- Ensured array-like objects with invalid
length
properties are treated like regular objects - Ensured
_.sortedIndex
supports arrays with highlength
values - Fixed
prototype
iteration bug in_.keys
- Optimized
_.times
&this
bindings in iterator methods
- Added
mobile
build option - Ensured
_.find
returnsundefined
for unmatched values - Ensured
_.templateSettings.variable
is compatible with Underscore - Optimized
_.escape
- Reduced dependencies of
_.find
- Adjusted the lodash export order for r.js
- Ensured
_.groupBy
values are added to own, not inherited, properties - Made
_.bind
follow ES5 spec to support a popular Backbone.js pattern - Removed the alias
_.intersect
- Simplified
_.bind
,_.flatten
,_.groupBy
,_.max
, &_.min
- Added
_.partial
- Added
thisArg
param to_.groupBy
- Added “lazy bind” support to
_.bind
- Added custom build options
- Added default
_.templateSettings.variable
value - Added native method overwrite detection to avoid bad native shims
- Added support for more AMD build optimizers & aliasing as the “underscore” module
- Added whitespace to compiled strings
- Commented the
iterationFactory
options object - Ensured
_(...)
returns given wrapper instances - Ensured
_.max
&_.min
support extremely large arrays - Ensured
_.throttle
works in tight loops - Fixed
clearTimeout
typo - Fixed
[DontEnum]
bug in IE < 9 - Fixed
prototype
iteration bug in Firefox < 3.6, Opera < 11.60, & Safari < 5.1 - Inlined
_.isFunction
calls - Made
_.debounce
’ed functions match_.throttle
’ed functions’ return value behavior - Made
_.escape
no longer translate the “>” character - Simplified all “Array” methods
- Optimized
_.debounce
,_.escape
,_.flatten
,_.forEach
,_.groupBy
,_.intersection
,_.invoke
,_.isObject
,_.max
,_.min
,_.pick
,_.shuffle
,_.sortedIndex
,_.template
,_.throttle
,_.union
,_.uniq
Apr. 23, 2012 — Docs
- Initial release