You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+51-42Lines changed: 51 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
-
#Lo-Dash <sup>v0.5.1</sup>
1
+
#Lo-Dash <sup>v0.5.2</sup>
2
2
3
-
A drop-in replacement<sup>[*](https://github.com/bestiejs/lodash/wiki/Drop-in-Disclaimer)</sup> for Underscore.js, from the devs behind[jsPerf.com](http://jsperf.com), delivering[performance](http://lodash.com/benchmarks),[bug fixes](https://github.com/bestiejs/lodash#resolved-underscorejs-issues-20), and[additional features](https://github.com/bestiejs/lodash#features).
3
+
A drop-in replacement<sup>[*](https://github.com/bestiejs/lodash/wiki/Drop-in-Disclaimer)</sup> for Underscore.js, from the devs behind[jsPerf.com](http://jsperf.com), delivering[performance](http://lodash.com/benchmarks),[bug fixes](https://github.com/bestiejs/lodash#resolved-underscorejs-issues-30), and[additional features](https://github.com/bestiejs/lodash#features).
4
4
5
5
Lo-Dash’s performance is gained by avoiding slower native methods, instead opting for simplified non-ES5 compliant methods optimized for common usage, and by leveraging function compilation to reduce the number of overall function calls.
* CDN copies of ≤[v0.5.1](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.5.1/lodash.min.js) are available on[cdnjs](http://cdnjs.com/) thanks to[CloudFlare](http://www.cloudflare.com/)
12
12
* For optimal performance,[create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
13
13
@@ -31,8 +31,8 @@ For more information check out these screencasts over Lo-Dash:
31
31
##Features
32
32
33
33
* AMD loader support ([RequireJS](http://requirejs.org/),[curl.js](https://github.com/cujojs/curl), etc.)
*[_.countBy](http://lodash.com/docs#countBy) as a compainion function for[_.groupBy](http://lodash.com/docs#groupBy) and[_.sortBy](http://lodash.com/docs#sortBy)
37
37
*[_.debounce](http://lodash.com/docs#debounce)’ed functions match[_.throttle](http://lodash.com/docs#throttle)’ed functions’ return value behavior
38
38
*[_.drop](http://lodash.com/docs#drop) for the inverse functionality of[_.pick](http://lodash.com/docs#pick)
@@ -41,7 +41,7 @@ For more information check out these screencasts over Lo-Dash:
41
41
*[_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties
*[_.template](http://lodash.com/docs#template) utilizes[sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging
@@ -92,7 +92,7 @@ lodash underscore
92
92
Custom builds may be created in three ways:
93
93
94
94
1. Use the`category` argument to pass the categories of methods to include in the build.<br>
* Allow iteration of objects with a`length` property[[#148](https://github.com/documentcloud/underscore/issues/148),[#154](https://github.com/documentcloud/underscore/issues/154),[#252](https://github.com/documentcloud/underscore/issues/252),[#448](https://github.com/documentcloud/underscore/issues/448),[#659](https://github.com/documentcloud/underscore/issues/659),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L552-558)]
173
-
* Ensure array-like objects with invalid`length` properties are treated like regular objects[[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L499-509)]
* Ensure templates compiled with errors are inspectable[[#666](https://github.com/documentcloud/underscore/issues/666),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L1240-1243)]
* Allow iteration of objects with a`length` property[[#148](https://github.com/documentcloud/underscore/issues/148),[#154](https://github.com/documentcloud/underscore/issues/154),[#252](https://github.com/documentcloud/underscore/issues/252),[#448](https://github.com/documentcloud/underscore/issues/448),[#659](https://github.com/documentcloud/underscore/issues/659),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L551-557)]
173
+
* Ensure array-like objects with invalid`length` properties are treated like regular objects[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L499-509)]
174
+
* Ensure*“Arrays”*, “Collections”, and “Objects”methods allow falsey arguments[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L1558-1593)]
* Ensure templates compiled with errors are inspectable[[#666](https://github.com/documentcloud/underscore/issues/666),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L1299-1302)]
* Handle arrays with`undefined` values correctly in IE < 9[[#601](https://github.com/documentcloud/underscore/issues/601)]
179
-
* Methods should work on pages with incorrectly shimmed native methods[[#7](https://github.com/documentcloud/underscore/issues/7),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L117-123)]
180
-
* Register as an AMD module, but still export to global[[#431](https://github.com/documentcloud/underscore/pull/431),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L101-115)]
181
-
*`_(…)` should return passed wrapper instances[[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L135-138)]
182
-
*`_.clone` should allow`deep` cloning[[#595](https://github.com/documentcloud/underscore/pull/595),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L205-220)]
183
-
*`_.contains` should work with strings[[#667](https://github.com/documentcloud/underscore/pull/667),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L275-284)]
184
-
*`_.escape` should return an empty string when passed`null` or`undefined`[[#427](https://github.com/documentcloud/underscore/issues/427),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L375-378)]
185
-
*`_.extend` should recursively extend objects[[#379](https://github.com/documentcloud/underscore/pull/379),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L892-914)]
186
-
*`_.forEach` should be chainable[[#142](https://github.com/documentcloud/underscore/issues/142),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L494-497)]
187
-
*`_.forEach` should allow exiting iteration early[[#211](https://github.com/documentcloud/underscore/issues/211),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L590-609)]
188
-
*`_.groupBy` should add values to own, not inherited, properties[[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L624-631)]
189
-
*`_.isEmpty` and`_.size` should support jQuery/MooTools DOM query collections[[#690](https://github.com/documentcloud/underscore/pull/690),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L724-729)]
190
-
*`_.isEqual` should return`true` for like-objects from different documents[[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L765-785)]
191
-
*`_.isObject` should avoid V8 bug[#2291](http://code.google.com/p/v8/issues/detail?id=2291)[[#605](https://github.com/documentcloud/underscore/issues/605),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L793-805)]
192
-
*`_.isNaN(new Number(NaN))` should return`true`[[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L813-815)]
193
-
*`_.keys` and`_.size` should work with`arguments` objects cross-browser[[#396](https://github.com/documentcloud/underscore/issues/396),[#653](https://github.com/documentcloud/underscore/issues/653),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L825-827)]
179
+
* Methods should work on pages with incorrectly shimmed native methods[[#7](https://github.com/documentcloud/underscore/issues/7),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L117-123)]
180
+
* Register as an AMD module, but still export to global[[#431](https://github.com/documentcloud/underscore/pull/431),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L101-115)]
181
+
*`_(…)` should return passed wrapper instances[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L135-138)]
182
+
*`_.clone` should allow`deep` cloning[[#595](https://github.com/documentcloud/underscore/pull/595),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L205-220)]
183
+
*`_.contains` should work with strings[[#667](https://github.com/documentcloud/underscore/pull/667),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L275-284)]
184
+
*`_.escape` should return an empty string when passed`null` or`undefined`[[#427](https://github.com/documentcloud/underscore/issues/427),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L375-378)]
185
+
*`_.extend` should recursively extend objects[[#379](https://github.com/documentcloud/underscore/pull/379),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L952-974)]
186
+
*`_.forEach` should be chainable[[#142](https://github.com/documentcloud/underscore/issues/142),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L494-497)]
187
+
*`_.forEach` should allow exiting iteration early[[#211](https://github.com/documentcloud/underscore/issues/211),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L589-608)]
188
+
*`_.groupBy` should add values to own, not inherited, properties[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L623-630)]
189
+
*`_.isElement` should use strict equality for its duck type check[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L704-713)]
190
+
*`_.isEmpty` and`_.size` should support jQuery/MooTools DOM query collections[[#690](https://github.com/documentcloud/underscore/pull/690),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L740-745)]
191
+
*`_.isEqual` should return`true` for like-objects from different documents[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L781-801)]
192
+
*`_.isObject` should avoid V8 bug[#2291](http://code.google.com/p/v8/issues/detail?id=2291)[[#605](https://github.com/documentcloud/underscore/issues/605),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L809-821)]
193
+
*`_.isNaN(new Number(NaN))` should return`true`[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L829-831)]
194
+
*`_.keys` and`_.size` should work with`arguments` objects cross-browser[[#396](https://github.com/documentcloud/underscore/issues/396),[#653](https://github.com/documentcloud/underscore/issues/653),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L885-887)]
194
195
*`_.once` should free the given function for garbage collection[[#693](https://github.com/documentcloud/underscore/pull/693)]
195
-
*`_.range` should coerce arguments to numbers[[#634](https://github.com/documentcloud/underscore/issues/634),[#683](https://github.com/documentcloud/underscore/issues/683),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L1050-1053)]
196
-
*`_.reduceRight` should pass correct callback arguments when iterating objects[[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L1061-1075)]
197
-
*`_.size` should return the`length` of string values[[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L1120-1122)]
198
-
*`_.size` shouldn’t error on falsey values[[#650](https://github.com/documentcloud/underscore/pull/650),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L1124-1131)]
199
-
*`_.sortedIndex` should support arrays with high`length` values[[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L1210-1219)]
200
-
*`_.template` should not augment the`options` object[[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L1234-1238)]
201
-
*`_.throttle` should work when called in a loop[[#502](https://github.com/documentcloud/underscore/issues/502),[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L1330-1340)]
202
-
*`_.zipObject` should accept less than two arguments[[test](https://github.com/bestiejs/lodash/blob/v0.5.1/test/test.js#L1457-1459)]
196
+
*`_.range` should coerce arguments to numbers[[#634](https://github.com/documentcloud/underscore/issues/634),[#683](https://github.com/documentcloud/underscore/issues/683),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L1110-1113)]
197
+
*`_.reduceRight` should pass correct callback arguments when iterating objects[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L1121-1135)]
198
+
*`_.size` should return the`length` of string values[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L1179-1181)]
199
+
*`_.size` shouldn’t error on falsey values[[#650](https://github.com/documentcloud/underscore/pull/650),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L1183-1190)]
200
+
*`_.sortedIndex` should support arrays with high`length` values[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L1269-1278)]
201
+
*`_.template` should not augment the`options` object[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L1293-1297)]
202
+
*`_.throttle` should work when called in a loop[[#502](https://github.com/documentcloud/underscore/issues/502),[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L1389-1399)]
203
+
*`_.toArray` uses custom`toArray` methods of arrays and strings[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L1426-1434)]
204
+
*`_.zipObject` should accept less than two arguments[[test](https://github.com/bestiejs/lodash/blob/v0.5.2/test/test.js#L1520-1522)]
203
205
204
206
##Optimized methods <sup>(50+)</sup>
205
207
@@ -263,6 +265,13 @@ require({
263
265
264
266
##Release Notes
265
267
268
+
###<sup>v0.5.2</sup>
269
+
270
+
* Ensured`_.isElement` uses strict equality for its duck type check
271
+
* Ensured`_.isObject` returns a boolean value
272
+
* Ensured`_.template` and*“Objects”* methods don’t error when passed falsey values
273
+
* Made`_.template` generate less unused code in compiled templates
274
+
266
275
###<sup>v0.5.1</sup>
267
276
268
277
* Ensured`_.bind` correctly appends array arguments to partially applied arguments in older browsers
@@ -276,10 +285,10 @@ require({
276
285
* Added support for exiting`_.forEach`,`_.forIn`, and`_.forOwn` early by returning`false` in the`callback`
277
286
* Added support for jQuery/MooTools DOM query collections to`_.isEmpty` and`_.size`
278
287
* Ensured development build works with IE conditional compilation enabled
279
-
* Ensured`_.clone` doesn't clone functions, DOM nodes,`arguments` objects, and objects created by constructors other than`Object`
280
-
* Ensured`_.filter`’s`callback` can't modify result values
288
+
* Ensured`_.clone` doesn’t clone functions, DOM nodes,`arguments` objects, and objects created by constructors other than`Object`
289
+
* Ensured`_.filter`’s`callback` can’t modify result values
* Ensured`_.isEqual` doesn't inspect DOM nodes, works with objects from other documents, and calls custom`isEqual` methods before checking strict equality
291
+
* Ensured`_.isEqual` doesn’t inspect DOM nodes, works with objects from other documents, and calls custom`isEqual` methods before checking strict equality
283
292
* Ensured`_.once` frees the given function for garbage collection
284
293
* Ensured`_.sortBy` performs a stable sort
285
294
* Ensured`reEvaluateDelimiter` is assigned when`_.templateSettings.evaluate` is undefined
@@ -290,7 +299,7 @@ The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/C
290
299
291
300
##BestieJS
292
301
293
-
Lo-Dash is part of the BestieJS*"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
302
+
Lo-Dash is part of the BestieJS*“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.