-
Notifications
You must be signed in to change notification settings - Fork 7k
Changelog
- Aligned _.isFinite & _.keys with ES
// in 2.4.1
_.isFinite('1'); // => true
_.keys('hi'); // => []
// in 3.0.0
_.isFinite('1'); // => false
_.keys('hi'); // => ['0', '1']
- Expanded the number of arguments provided to
customizer
callbacks of
_.assign, _.clone, _.cloneDeep, _.isEqual, & _.merge
var object = { 'a': 1 },
other = { 'a': 2 },
customizer = function() { console.log(arguments); };
// in 2.4.1
_.merge(object, other, customizer); // => logs [1, 2]
// in 3.0.0
_.merge(object, other, customizer); // => logs [1, 2, 'a', object, other]
- Made the execution of chained methods lazy, that is, execution is deferred until
_#value
is implicitly or explicitly called
// in 2.4.1
_([1, 2, 3]).forEach(function(n) { console.log(n); });
// => logs each value from left to right and returns the lodash wrapper
// in 3.0.0
_([1, 2, 3]).forEach(function(n) { console.log(n); });
// => returns the lodash wrapper without logging until `value` is called
_([1, 2, 3]).forEach(function(n) { console.log(n); }).value();
// => logs each value from left to right and returns the array
- Made _.clone & _.cloneDeep return a new object for unsupported types
// in 2.4.1
_.clone(document.body); // => document.body
// in 3.0.0
_.clone(document.body); // => {}
- Made _.flatten shallow by default & remove
callback
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]
_(objects).pluck('a').flatten().value(); // [1, 2, 3]
// legacy usage path available for those writing code for both lodash & underscore
_.flatten(array, !!_.flattenDeep);
var array = [2, 3, 1];
// in 2.4.1
_(array).max().value(); // => 3
// in 3.0.0
_(array).max(); // => 3
- Made _.memoize cache implement the ES
Map
interface
var m = _.memoize(_.identity);
m('a');
// in 2.4.1
m.cache; // => { '1420168181178a': 'a' }
// in 3.0.0
m.cache.has('a'); // => true
var array = [['a'], [1]];
// in 2.4.1
_.zip(array); // => [['a', 1]]
_.unzip(array); // => [['a', 1]]
// in 3.0.0
_.zip(array); // => [[['a']], [[1]]]
_.unzip(array); // => [['a', 1]]
- Removed result sorting from _.functions
var object = { 'c': _.noop, 'b': _.noop, 'a': _.noop };
// in 2.4.1
_.functions(object); // => ['a', 'b', 'c']
// in 3.0.0
_.functions(object); // => ['c', 'b', 'a']
- 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'
// legacy usage path available for those writing code for both lodash & underscore
_.template(string, null, options)(data); // => 'b'
- Restricted
_.mixin
to iterating only own properties ofsource
objects
function Foo() {};
Foo.prototype.bar = function() {};
var object = {};
// in 2.4.1
_.mixin(object, new Foo);
_.has(object, 'bar'); // => true
// in 3.0.0
_.mixin(object, new Foo);
_.has(object, 'bar'); // => false
_.mixin(object, _.toPlainObject(new Foo));
_.has(object, 'bar'); // => true
- Split _.first & _.last out into _.take, _.takeWhile, _.takeRight, & _.takeRightWhile for
n
&predicate
use
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 out into _.dropRight, _.dropRightWhile, _.drop, & _.dropWhile for
n
&predicate
use
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]
- Changed the categories of
_.clone
,_.cloneDeep
, &_.isXyz
methods from “Object” to “Lang” - Changed the categories of
_.escape
,_.template
, &_.unescape
from “Utility” to “String” - Changed the category of
_.range
from “Array” to “Utility” - Changed the category of
_.toArray
from “Collection” to “Lang” - Made method categories singular
- Moved ./dist/lodash.js to ./lodash.js in master & to ./index.js in npm
- Moved ./dist/lodash.compat.js to the lodash/lodash-compat repository
- Moved support for sorting by multiple properties from
_.sortBy
to _.sortByAll - Removed the
underscore
build - Renamed
_.createCallback
to _.callback - Renamed
_.support.argsClass
&_.support.nodeClass
to _.support.argsTag & _.support.nodeTag
- 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 assign thecustomizer
result if it’s the same as the destination value - Ensured
_.mixin
does not extend lodash whenobject
is provided with an emptyoptions
object - Ensured
_.sortedIndex
returns values that align with the sort order of_.sortBy
- Ensured functions created by
_.matches
returntrue
when comparing empty array & objectsource
values - 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
-
_.backflow
&_.compose
as aliases of _.flowRight -
_.contains
as an alias of _.includes -
_.iteratee
as an alias of _.callback -
_#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 customizable argument 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
cancel
method to debounced & throttled functions - Added
multiValue
flag to _.invert,defaultValue
argument to _.result, &thisArg
argument to _.tap - Added _.memoize.Cache to enable ES
Map
/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
- Avoided memory leaks in
_.bind
,_.bindKey
,_.curry
,_.partial
, &_.partialRight
- Ensured
_.at
,_.invoke
,_.matches
,_.property
, &_.pullAt
work with falseyarray
&collection
values when keys are provided - Ensured
_.callback
doesn’t error whenfunc
is nullish & athisArg
is provided - 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
_.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 arrays & plain 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
_.omit
&_.pick
work on primitives - Ensured
_.partial
&_.partialRight
work with curried functions - Ensured
_.pluck
always uses_.property
&_.findWhere
&_.where
always use_.matches
- 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 it as theaccumulator
[[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 ES ToLength
- Made use of ES Set in
_.difference
,_.intersection
, &_.uniq
- Removed array & object pools
- Removed all method compilation from the
compat
build - Updated sourceURL syntax & allowed the
sourceURL
option of_.template
to work in production builds
Check out the lodash-cli changelog for changes to lodash-cli as well.
- Ensured
__bindData__
is properly cloned - Ensured
_.isEqual
correctly compares objects with shared property values containing circular references - Optimized
_.partial
&_.partialRight
- Reached ~100% code coverage
- Added
_.constant
,_.mapValues
,_.now
,_.property
, &_.xor
- Added an
options
argument to_.mixin
to specify whether the functions added are chainable - Added support for
_.sortBy
to accept an array of property names to sort by - Allowed
_.zipObject
to accept an array ofkeys
with novalues
argument - Removed conditional
setImmediate
use from_.defer
- Added
_.create
&_.noop
- Avoided memory leaks in
_.debounce
&_.throttle
- Enhanced
_.createCallback
to avoid binding functions already bound byFunction#bind
- Ensured rebound functions correctly partially apply arguments
- Ensured
_.isEqual
works with objects created byObject.create(null)
&_(false)
- Ensured
_.min
&_.max
work as callbacks for_.map
- Ensured
_.template
coerces thetext
argument to a string - Optimized
_.difference
,_.omit
, &_.without
by way ofbaseDifference
- Optimized
_.isBoolean
,_.isNumber
,_.isString
,_.omit
, &_.without
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 support for shallow cloning dates, regexes, & other non-plain built-in objects to
_.clone
- Ensured
_.random
avoids excessive results of0
when returning 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 - Allowed
_.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, even those that normally return unwrapped values - Moved the build utility to
lodash-cli
- Optimized
_.contains
,_.debounce
,_.isArguments
,_.throttle
,_.where
, & functions created by_.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 “Arrays” methods support
arguments
objects - Ensured “Functions” methods throw when not passed functions
- Ensured
_.at
works as a callback for_.map
- Ensured
_.createCallback
works when noargCount
is specified - Ensured
_.first
&_.last
return arrays when passed a falseyarray
with ann
value - 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
method - 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
- Allowed 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 acallback
for methods like_.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
argument to_.debounce
&_.throttle
- Allowed non-
underscore
builds to include_.findWhere
&_.chain
- Ensured “Arrays” & “Objects” category 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
passes 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
argument - Updated vendor/tar to work with Node v0.10.x
- Added
rhino -require
support - Added
_.createCallback
,_findIndex
,_.findKey
,_.parseInt
,_.runInContext
, &_.support
- Added
callback
&thisArg
arguments to_.flatten
- Added CommonJS/Node 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 nonexistent directories of
--output
paths - Optimized method chaining, object iteration,
_.find
, &_.pluck
- Updated
backbone
build lodash method dependencies
- Added support for specifying source map URLs in
-p
/--source-map
build options - Ensured the second argument passed to
_.assign
is not treated as acallback
- Ensured
-p
/--source-map
build options correctly set thesourceMappingURL
- Made
-p
/--source-map
build options set source map “sources” keys based on the builds performed - 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 “imports” option to
_.templateSettings
- Added
modern
&-p
/--source-map
build options - 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 triggering 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
arguments to_.assign
,_.clone
,_.cloneDeep
,_.first
,_.last
,_.initial
,_.isEqual
,_.merge
, &_.rest
- Made
_#join
,_#pop
, &_#shift
wrapper methods return unwrapped values - Made “Functions” methods wrapper counterparts return wrapped values
- Removed
_.chain
&_#chain
methods
- Added
_.once
to thebackbone
build method dependencies - Ensured
backbone
builds implement Underscore’s chaining behavior - Ensured the
settings=…
build option doesn’t clobber the defaultmoduleId
- Ensured lodash’s npm package installation avoids erroring when no other modules have been globally installed
- Made
_.cloneDeep
an alias of_.clone(…, true)
- Made compiled templates loaded via AMD use the lodash module for their
_
references - Removed the “Collections” method
_.forEach
dependency from “Arrays” method_.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
- Made
_(…)
chain automatically without needing to call_#chain
- Made
_.isEqual
equatearguments
objects to similarObject
objects - Made
_.clone
copy the enumerable properties ofarguments
objects & objects created by constructors other thanObject
are cloned to plainObject
objects
- Ensure lodash runs in the JS engine embedded in Adobe products
- Ensured
_.reduce
&_.reduceRight
pass the correct number ofcallback
arguments - Ensured
_.throttle
nulls thetimeoutId
- Made deep
_.clone
more closely follow the structured clone algorithm & copy array properties assigned byRegExp#exec
- 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 with ESObject.assign
- Added the build commands used to custom build copyright/license headers
- Added
_.assign
- Ensured the
underscore
build of_.find
returns the first, not last, matched value - 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
argument 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 ES 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 passed 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 passed 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
- Made
underscore
build include deep clone whenclone
is requested viainclude
orplus
- Reverted removal of first argument falsey checks from methods
- Made
_.random
return0
or1
when no arguments are passed - 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
- Allowed
_.sortedIndex
to accept a property name as thecallback
argument - 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
arguments 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
& “Objects” methods don’t error when passed 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
_.forEach
,_.forIn
, &_.forOwn
early by returningfalse
in thecallback
- Added support for jQuery/MooTools DOM query collections to
_.isEmpty
&_.size
- Ensured development build works with IE conditional compilation enabled
- Ensured
_.clone
doesn’t clone functions, DOM nodes,arguments
objects, & objects created by constructors other thanObject
- 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 assigned when_.templateSettings.evaluate
is undefined - Made
_.range
coerce arguments to numbers - Optimized
_.isFunction
- Added
strict
build option - Ensured
_.bindAll
,_.defaults
, &_.extend
avoid strict mode errors when attempting to augment 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 passing strings to “Collections” methods
- Added
_.zipObject
- Leveraged
_.indexOf
’sfromIndex
in_.difference
&_.without
- Optimized compiled templates
- Optimized inlining the
iteratorTemplate
for builds - Optimized object iteration for “Collections” 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 “Collections” category - Removed
arguments
object from_.range
- Ensured
_.escape
returns an empty string when passed 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 “Collections” category - Moved
_.tap
to the “Chaining” category
- Added
backbone
build option - Ensured “Arrays” category methods allow falsey
array
arguments - Removed
_.isArguments
fallback from themobile
build - Simplified
_.pluck
,_.values
&_(...)
method wrappers
- Added
category
build option - Added
fromIndex
argument to_.indexOf
&_.lastIndexOf
- Added
//@ sourceURL
support to_.template
- Added
thisArg
argument to_.sortedIndex
&_.uniq
- Added
_.forIn
&_.forOwn
methods - Ensured array-like objects with invalid
length
properties are treated like regular objects - Ensured
_.sortedIndex
supports arrays with highlength
values - Fixed
prototype
property iteration bug in_.keys
for Firefox < 3.6, Opera > 9.50 - Opera < 11.60, & Safari < 5.1 - 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 in
_.find
- Adjusted the lodash export order for r.js
- Ensured
_.groupBy
values are added to own, not inherited, properties - Made
_.bind
follow ES spec to support a popular Backbone.js pattern - Removed the alias
_.intersect
- Simplified
_.bind
,_.flatten
,_.groupBy
,_.max
, &_.min
- Added custom build options
- Added default
_.templateSettings.variable
value - Added “lazy bind” support to
_.bind
- Added native method overwrite detection to avoid bad native shims
- Added
_.partial
method - Added support for more AMD build optimizers & aliasing as the “underscore” module
- Added
thisArg
argument to_.groupBy
- Added whitespace to compiled strings
- Commented the
iterationFactory
options object - Ensured
_(...)
returns passed wrapper instances - Ensured
_.max
&_.min
support extremely large arrays - Ensured
_.throttle
works in tight loops - Fixed
clearTimeout
typo - Fixed IE < 9
[DontEnum]
bug & Firefox < 3.6, Opera > 9.50 - Opera < 11.60, & Safari < 5.1’sprototype
property iteration bug - Inlined
_.isFunction
calls. - Made
_.debounce
’ed functions match_.throttle
’ed functions’ return value behavior - Made
_.escape
no longer translate the “>” character - Simplified all methods in the “Arrays” category
- Optimized
_.debounce
,_.escape
,_.flatten
,_.forEach
,_.groupBy
,_.intersection
,_.invoke
,_.isObject
,_.max
,_.min
,_.pick
,_.shuffle
,_.sortedIndex
,_.template
,_.throttle
,_.union
,_.uniq
Apr. 23, 2012 — Docs
- Initial release
Maintained by the core team with help from our contributors.