From 7467a2a2eb8493acdba518e25afab3266560240f Mon Sep 17 00:00:00 2001 From: jdalton Date: Mon, 18 Feb 2013 03:13:40 -0700 Subject: [PATCH] Bump to v1.0.2. --- README.md | 240 +---- dist/lodash.compat.js | 8 +- dist/lodash.compat.min.js | 4 +- dist/lodash.js | 10 +- dist/lodash.min.js | 71 +- dist/lodash.underscore.js | 8 +- dist/lodash.underscore.min.js | 4 +- doc/README.md | 1694 +++++++++++++++++---------------- doc/parse.php | 30 +- lodash.js | 8 +- package.json | 60 +- 11 files changed, 1023 insertions(+), 1114 deletions(-) diff --git a/README.md b/README.md index 6181c7790f..25692dda79 100644 --- a/README.md +++ b/README.md @@ -1,190 +1,30 @@ -# Lo-Dash v1.0.1 -[![build status](https://secure.travis-ci.org/bestiejs/lodash.png)](http://travis-ci.org/bestiejs/lodash) +# Lo-Dash v1.0.2 -An alternative to Underscore.js, delivering consistency, [customization](https://github.com/bestiejs/lodash#custom-builds), [performance](http://lodash.com/benchmarks), and [extra features](https://github.com/bestiejs/lodash#features). +A utility library delivering consistency, [customization](https://lodash.com/custom-builds), [performance](https://lodash.com/benchmarks), & [extras](https://lodash.com/#features). ## Download * Lo-Dash builds (for modern environments):
-[Development](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.js) and -[Production](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.min.js) +[Development](https://raw.github.com/lodash/lodash/1.0.2/dist/lodash.js) and +[Production](https://raw.github.com/lodash/lodash/1.0.2/dist/lodash.min.js) * Lo-Dash compatibility builds (for legacy and modern environments):
-[Development](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.compat.js) and -[Production](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.compat.min.js) +[Development](https://raw.github.com/lodash/lodash/1.0.2/dist/lodash.compat.js) and +[Production](https://raw.github.com/lodash/lodash/1.0.2/dist/lodash.compat.min.js) * Underscore compatibility builds:
-[Development](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.underscore.js) and -[Production](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.underscore.min.js) +[Development](https://raw.github.com/lodash/lodash/1.0.2/dist/lodash.underscore.js) and +[Production](https://raw.github.com/lodash/lodash/1.0.2/dist/lodash.underscore.min.js) -* CDN copies of ≤ v1.0.1’s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):
-[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.js), -[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.min.js),
-[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.compat.js), -[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.compat.min.js),
-[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.underscore.js), and -[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.underscore.min.js) - -* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need +* For optimal file size, [create a custom build](https://lodash.com/custom-builds) with only the features you need ## Dive in -We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests). - -For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap). - -## Resources - -For more information check out these articles, screencasts, and other videos over Lo-Dash: - - * Posts - - [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/) - - * Videos - - [Introducing Lo-Dash](https://vimeo.com/44154599) - - [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601) - - [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600) - - [Unit testing in Lo-Dash](https://vimeo.com/45865290) - - [Lo-Dash’s approach to native method use](https://vimeo.com/48576012) - - [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk) - -## Features - - * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.) - * [_(…)](http://lodash.com/docs#_) supports intuitive chaining - * [_.at](http://lodash.com/docs#at) for cherry-picking collection values - * [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods - * [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays and objects - * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument - * [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early - * [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties - * [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties - * [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor - * [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend) - * [_.partial](http://lodash.com/docs#partial) and [_.partialRight](http://lodash.com/docs#partialRight) for partial application without `this` binding - * [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * [_.where](http://lodash.com/docs#where) supports deep object comparisons - * [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), - [and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments - * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray), - [and more…](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings - * [_.filter](http://lodash.com/docs#filter), [_.find](http://lodash.com/docs#find), [_.map](http://lodash.com/docs#map), - [and more…](http://lodash.com/docs "_.countBy, _.every, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* and *“_.where”* `callback` shorthands - -## Support - -Lo-Dash has been tested in at least Chrome 5~24, Firefox 1~18, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.20, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5. - -## Custom builds - -Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need. -To top it off, we handle all method dependency and alias mapping for you. - - * Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument. -```bash -lodash backbone -``` - - * CSP builds, supporting default [Content Security Policy](https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html) restrictions, may be created using the `csp` modifier argument. - The `csp` modifier is an alais of the `mobile` modifier. Lo-Dash may be used in Chrome extensions by using either the `csp`, `mobile`, or `underscore` build and using precompiled templates, or loading Lo-Dash in a [sandbox](http://developer.chrome.com/stable/extensions/sandboxingEval.html). -```bash -lodash csp -``` - - * Legacy builds, tailored for older environments without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument. -```bash -lodash legacy -``` +We’ve got [API docs](https://lodash.com/docs), [benchmarks](https://lodash.com/benchmarks), and [unit tests](https://lodash.com/tests). - * Modern builds, tailored for newer environments with ES5 support, may be created using the `modern` modifier argument. -```bash -lodash modern -``` - - * Mobile builds, without method compilation and most bug fixes for old browsers, may be created using the `mobile` modifier argument. -```bash -lodash mobile -``` - - * Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument. -```bash -lodash strict -``` - - * Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument. -```bash -lodash underscore -``` +For a list of upcoming features, check out our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap). -Custom builds may be created using the following commands: - - * Use the `category` argument to pass comma separated categories of methods to include in the build.
- Valid categories (case-insensitive) are *“arrays”*, *“chaining”*, *“collections”*, *“functions”*, *“objects”*, and *“utilities”*. -```bash -lodash category=collections,functions -lodash category="collections, functions" -``` - - * Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.
- Valid exports are *“amd”*, *“commonjs”*, *“global”*, *“node”*, and *“none”*. -```bash -lodash exports=amd,commonjs,node -lodash exports="amd, commonjs, node" -``` - - * Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash. -```bash -lodash iife="!function(window,undefined){%output%}(this)" -``` - - * Use the `include` argument to pass comma separated method/category names to include in the build. -```bash -lodash include=each,filter,map -lodash include="each, filter, map" -``` - - * Use the `minus` argument to pass comma separated method/category names to remove from those included in the build. -```bash -lodash underscore minus=result,shuffle -lodash underscore minus="result, shuffle" -``` - - * Use the `plus` argument to pass comma separated method/category names to add to those included in the build. -```bash -lodash backbone plus=random,template -lodash backbone plus="random, template" -``` - - * Use the `template` argument to pass the file path pattern used to match template files to precompile. -```bash -lodash template="./*.jst" -``` - - * Use the `settings` argument to pass the template settings used when precompiling templates. -```bash -lodash settings="{interpolate:/\{\{([\s\S]+?)\}\}/g}" -``` - - * Use the `moduleId` argument to specify the AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates. -```bash -lodash moduleId="underscore" -``` - -All arguments, except `legacy` with `csp`, `mobile`, `modern`, or `underscore`, may be combined.
-Unless specified by `-o` or `--output`, all files created are saved to the current working directory. - -The following options are also supported: - - * `-c`, `--stdout` ......... Write output to standard output - * `-d`, `--debug` ........... Write only the non-minified development output - * `-h`, `--help` ............. Display help information - * `-m`, `--minify` ......... Write only the minified production output - * `-o`, `--output` ......... Write output to a given path/filename - * `-p`, `--source-map` .. Generate a source map for the minified output, using an optional source map URL - * `-s`, `--silent` ......... Skip status updates normally logged to the console - * `-V`, `--version` ....... Output current version of Lo-Dash - -The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`). +The full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog). ## Installation and usage @@ -245,32 +85,44 @@ require({ }); ``` -## Release Notes - -### v1.0.1 - - * Add support for specifying source map URLs in `-p`/`--source-map` build options - * Ensured the second argument passed to `_.assign` is not treated as a `callback` - * Ensured `-p`/`--source-map` build options correctly set the `sourceMappingURL` - * Made `-p`/`--source-map` build options set source map *“sources”* keys based on the builds performed - * Made `_.defer` use `setImmediate`, in Node.js, when available - * Made `_.where` search arrays for values regardless of their index position - * Removed dead code from `_.template` +## Resources -The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog). +For more information check out these articles, screencasts, and other videos over Lo-Dash: -## BestieJS + * Posts + - [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/) -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. + * Videos + - [Introducing Lo-Dash](https://vimeo.com/44154599) + - [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601) + - [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600) + - [Unit testing in Lo-Dash](https://vimeo.com/45865290) + - [Lo-Dash’s approach to native method use](https://vimeo.com/48576012) + - [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk) -## Author +## Features -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") + * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.) + * [_(…)](https://lodash.com/docs#_) supports intuitive chaining + * [_.at](https://lodash.com/docs#at) for cherry-picking collection values + * [_.bindKey](https://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods + * [_.cloneDeep](https://lodash.com/docs#cloneDeep) for deep cloning arrays and objects + * [_.contains](https://lodash.com/docs#contains) accepts a `fromIndex` argument + * [_.forEach](https://lodash.com/docs#forEach) is chainable and supports exiting iteration early + * [_.forIn](https://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties + * [_.forOwn](https://lodash.com/docs#forOwn) for iterating over an object’s own properties + * [_.isPlainObject](https://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor + * [_.merge](https://lodash.com/docs#merge) for a deep [_.extend](https://lodash.com/docs#extend) + * [_.partial](https://lodash.com/docs#partial) and [_.partialRight](https://lodash.com/docs#partialRight) for partial application without `this` binding + * [_.template](https://lodash.com/docs#template) supports [*“imports”* options](https://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * [_.where](https://lodash.com/docs#where) supports deep object comparisons + * [_.clone](https://lodash.com/docs#clone), [_.omit](https://lodash.com/docs#omit), [_.pick](https://lodash.com/docs#pick), + [and more…](https://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments + * [_.contains](https://lodash.com/docs#contains), [_.size](https://lodash.com/docs#size), [_.toArray](https://lodash.com/docs#toArray), + [and more…](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings + * [_.filter](https://lodash.com/docs#filter), [_.find](https://lodash.com/docs#find), [_.map](https://lodash.com/docs#map), + [and more…](https://lodash.com/docs "_.countBy, _.every, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* and *“_.where”* `callback` shorthands -## Contributors +## Support -* [Kit Cambridge](http://kitcambridge.github.com/) - [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") -* [Mathias Bynens](http://mathiasbynens.be/) - [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") +Lo-Dash has been tested in at least Chrome 5~24, Firefox 1~18, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.20, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5. diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 37ebc920be..7f15e1815e 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -1,11 +1,11 @@ /** * @license - * Lo-Dash 1.0.1 (Custom Build) + * Lo-Dash 1.0.2 (Custom Build) * Build: `lodash -o ./dist/lodash.compat.js` * Copyright 2012-2013 The Dojo Foundation * Based on Underscore.js 1.4.4 * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. - * Available under MIT license + * Available under MIT license */ ;(function(window, undefined) { @@ -4592,7 +4592,7 @@ * build and using precompiled templates, or loading Lo-Dash in a sandbox. * * For more information on precompiling templates see: - * http://lodash.com/#custom-builds + * https://lodash.com/#custom-builds * * For more information on Chrome extension sandboxes see: * http://developer.chrome.com/stable/extensions/sandboxingEval.html @@ -5066,7 +5066,7 @@ * @memberOf _ * @type String */ - lodash.VERSION = '1.0.1'; + lodash.VERSION = '1.0.2'; // add "Chaining" functions to the wrapper lodash.prototype.toString = wrapperToString; diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index adb164d973..6969d4bd24 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -1,6 +1,6 @@ /** * @license - * Lo-Dash 1.0.1 (Custom Build) lodash.com/license + * Lo-Dash 1.0.2 (Custom Build) lodash.com/license * Build: `lodash -o ./dist/lodash.compat.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ @@ -37,6 +37,6 @@ return Et.apply(r,arguments),t.apply(this,r)}},r.zip=function(n){for(var t=-1,r= },r.isString=A,r.isUndefined=function(n){return typeof n=="undefined"},r.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?qt(0,e+r):Dt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=H,r.noConflict=function(){return n._=ct,this},r.random=function(n,t){return n==W&&t==W&&(t=1),n=+n||0,t==W&&(t=n,n=0),n+Ot(Tt()*((+t||0)-n+1))},r.reduce=D,r.reduceRight=T,r.result=function(n,r){var e=n?n[r]:t;return w(e)?n[r]():e},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:vr(n).length },r.some=B,r.sortedIndex=K,r.template=function(n,e,u){var o=r.templateSettings;n||(n=""),u=mr({},u,o);var i,f=mr({},u.imports,o.imports),o=vr(f),f=E(f),a=0,l=u.interpolate||dt,p="__p+='";n.replace(RegExp((u.escape||dt).source+"|"+l.source+"|"+(l===mt?ht:dt).source+"|"+(u.evaluate||dt).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(bt,c),r&&(p+="'+__e("+r+")+'"),o&&(i=Q,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",l=u=u.variable,l||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(pt,""):p).replace(st,"$1").replace(vt,"$1;"),p="function("+u+"){"+(l?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+p+"return __p}"; try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return e?s(e):(s.source=p,s)},r.unescape=function(n){return n==W?"":(n+"").replace(lt,g)},r.uniqueId=function(n){var t=++it;return(n==W?"":n+"")+t},r.all=I,r.any=B,r.detect=R,r.foldl=D,r.foldr=T,r.include=k,r.inject=D,pr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return Et.apply(t,arguments),n.apply(r,t)})}),r.first=M,r.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=W){var o=u; -for(t=f(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==W||r)return n[u-1];return v(n,qt(0,u-e))}},r.take=M,r.head=M,pr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return t==W||e&&typeof t!="function"?u:new r(u)})}),r.VERSION="1.0.1",r.prototype.toString=function(){return this.__wrapped__+""},r.prototype.value=J,r.prototype.valueOf=J,cr(["join","pop","shift"],function(n){var t=ut[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),cr(["push","reverse","sort","unshift"],function(n){var t=ut[n]; +for(t=f(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==W||r)return n[u-1];return v(n,qt(0,u-e))}},r.take=M,r.head=M,pr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return t==W||e&&typeof t!="function"?u:new r(u)})}),r.VERSION="1.0.2",r.prototype.toString=function(){return this.__wrapped__+""},r.prototype.value=J,r.prototype.valueOf=J,cr(["join","pop","shift"],function(n){var t=ut[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),cr(["push","reverse","sort","unshift"],function(n){var t=ut[n]; r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),cr(["concat","slice","splice"],function(n){var t=ut[n];r.prototype[n]=function(){return new r(t.apply(this.__wrapped__,arguments))}}),Qt&&cr(["pop","shift","splice"],function(n){var t=ut[n],e="splice"==n;r.prototype[n]=function(){var n=this.__wrapped__,u=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new r(u):u}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r })):Y?Z?(Z.exports=r)._=r:Y._=r:n._=r})(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 67c6055838..46b67479ee 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -1,11 +1,11 @@ /** * @license - * Lo-Dash 1.0.1 (Custom Build) + * Lo-Dash 1.0.2 (Custom Build) * Build: `lodash modern -o ./dist/lodash.js` * Copyright 2012-2013 The Dojo Foundation * Based on Underscore.js 1.4.4 * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. - * Available under MIT license + * Available under MIT license */ ;(function(window, undefined) { @@ -1644,7 +1644,7 @@ * _.isPlainObject({ 'name': 'moe', 'age': 40 }); * // => true */ - var isPlainObject = function(value) { + var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { if (!(value && typeof value == 'object')) { return false; } @@ -4442,7 +4442,7 @@ * build and using precompiled templates, or loading Lo-Dash in a sandbox. * * For more information on precompiling templates see: - * http://lodash.com/#custom-builds + * https://lodash.com/#custom-builds * * For more information on Chrome extension sandboxes see: * http://developer.chrome.com/stable/extensions/sandboxingEval.html @@ -4916,7 +4916,7 @@ * @memberOf _ * @type String */ - lodash.VERSION = '1.0.1'; + lodash.VERSION = '1.0.2'; // add "Chaining" functions to the wrapper lodash.prototype.toString = wrapperToString; diff --git a/dist/lodash.min.js b/dist/lodash.min.js index c898ff0f0c..b9bf192369 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -1,40 +1,41 @@ /** * @license - * Lo-Dash 1.0.1 (Custom Build) lodash.com/license + * Lo-Dash 1.0.2 (Custom Build) lodash.com/license * Build: `lodash modern -o ./dist/lodash.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ -;(function(n,t){function r(n){if(!n||typeof n!="object")return W;var t=n.valueOf,r=typeof t=="function"&&(r=bt(t))&&bt(r);if(r)n=n==r||bt(n)==r&&!h(n);else{var e=W;!n||typeof n!="object"||h(n)?n=e:(t=n.constructor,!j(t)||t instanceof t?(Yt(n,function(n,t){e=t}),n=e===W||jt.call(n,e)):n=e)}return n}function e(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof e?(this.__wrapped__=n,void 0):new e(n)}function u(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||ut);if(u){var o={};for(r=t-1;++rt||typeof n=="undefined")return 1;if(nr?0:r);++er?Nt(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):z(n,t,r)):Xt(n,function(n){return++eu&&(u=f)}}else t=!t&&A(n)?o:a(t,r),Xt(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});return u}function D(n,t,r,e){var u=3>arguments.length;if(t=a(t,e,4),nr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++oarguments.length;if(typeof u!="number")var i=tr(n),u=i.length;return t=a(t,e,4),$(n,function(e,f,a){f=i?i[--u]:--u,r=o?(o=W,n[f]):t(r,n[f],f,a)}),r}function T(n,t,r){var e;if(t=a(t,r),nr(n)){r=-1;for(var u=n.length;++rr?Nt(0,u+r):r||0)-1;else if(r)return e=C(n,t),n[e]===t?e:-1;for(;++e>>1,r(n[e])z(f,p))&&((r||c)&&f.push(p),i.push(e))}return i}function U(n,t){return Kt||At&&2/g,gt=/($^)/,ht=/[&<>"']/g,yt=/['\n\r\t\u2028\u2029\\]/g,mt=Math.ceil,dt=nt.concat,_t=Math.floor,bt=pt.test(bt=Object.getPrototypeOf)&&bt,jt=tt.hasOwnProperty,wt=nt.push,xt=tt.toString,At=pt.test(At=v.bind)&&At,Ot=pt.test(Ot=Array.isArray)&&Ot,Et=n.isFinite,St=n.isNaN,kt=pt.test(kt=Object.keys)&&kt,Nt=Math.max,Rt=Math.min,$t=Math.random,Ft="[object Arguments]",qt="[object Array]",Dt="[object Boolean]",It="[object Date]",Tt="[object Number]",Bt="[object Object]",Mt="[object RegExp]",zt="[object String]",Pt=!!n.attachEvent,Ct=At&&!/\n|true/.test(At+Pt),Kt=At&&!Ct,Ut=kt&&(Pt||Ct),Vt={"[object Function]":W}; -Vt[Ft]=Vt[qt]=Vt[Dt]=Vt[It]=Vt[Tt]=Vt[Bt]=Vt[Mt]=Vt[zt]=L;var Gt={};Gt[qt]=Array,Gt[Dt]=Boolean,Gt[It]=Date,Gt[Bt]=Object,Gt[Tt]=Number,Gt[Mt]=RegExp,Gt[zt]=String;var Ht={"boolean":W,"function":L,object:L,number:W,string:W,undefined:W},Jt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:vt,variable:"",imports:{_:e}};var Lt={a:"q,w,h",l:"var a=arguments,b=0,c=typeof h=='number'?2:a.length;while(++b":">",'"':""","'":"'"},er=_(rr),ur=c(Lt,{l:Lt.l.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=f(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),h:"u[j]=d?d(u[j],n[j]):n[j]"}),or=c(Lt);j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==xt.call(n)}),Ct&&Y&&typeof setImmediate=="function"&&(V=U(setImmediate,n)),e.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0 -}},e.assign=ur,e.at=function(n){for(var t=-1,r=dt.apply(nt,v(arguments,1)),e=r.length,u=Array(e);++tz(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(e[s]||(e[s]=u(t[s],0,100)))(l))continue n;a.push(l)}}return a},e.invert=_,e.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return $(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},e.keys=tr,e.map=F,e.max=q,e.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+""; -return jt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},e.merge=O,e.min=function(n,t,r){var e=1/0,u=e;if(!t&&nr(n)){r=-1;for(var i=n.length;++rz(o,r,1))&&(u[r]=n) -}),u},e.once=function(n){var t,r;return function(){return t?r:(t=L,r=n.apply(this,arguments),n=Q,r)}},e.pairs=function(n){for(var t=-1,r=tr(n),e=r.length,u=Array(e);++tr?Nt(0,e+r):Rt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},e.mixin=H,e.noConflict=function(){return n._=ot,this},e.random=function(n,t){return n==Q&&t==Q&&(t=1),n=+n||0,t==Q&&(t=n,n=0),n+_t($t()*((+t||0)-n+1)) -},e.reduce=D,e.reduceRight=I,e.result=function(n,r){var e=n?n[r]:t;return j(e)?n[r]():e},e.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:tr(n).length},e.some=T,e.sortedIndex=C,e.template=function(n,r,u){var o=e.templateSettings;n||(n=""),u=or({},u,o);var i,f=or({},u.imports,o.imports),o=tr(f),f=E(f),a=0,c=u.interpolate||gt,p="__p+='";n.replace(RegExp((u.escape||gt).source+"|"+c.source+"|"+(c===vt?st:gt).source+"|"+(u.evaluate||gt).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(yt,l),r&&(p+="'+__e("+r+")+'"),o&&(i=L,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t -}),p+="';\n",c=u=u.variable,c||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(ft,""):p).replace(at,"$1").replace(ct,"$1;"),p="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+p+"return __p}";try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return r?s(r):(s.source=p,s)},e.unescape=function(n){return n==Q?"":(n+"").replace(it,g)},e.uniqueId=function(n){var t=++rt;return(n==Q?"":n+"")+t -},e.all=k,e.any=T,e.detect=R,e.foldl=D,e.foldr=I,e.include=S,e.inject=D,Zt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(){var t=[this.__wrapped__];return wt.apply(t,arguments),n.apply(e,t)})}),e.first=B,e.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=Q){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==Q||r)return n[u-1];return v(n,Nt(0,u-e))}},e.take=B,e.head=B,Zt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(t,r){var u=n(this.__wrapped__,t,r); -return t==Q||r&&typeof t!="function"?u:new e(u)})}),e.VERSION="1.0.1",e.prototype.toString=function(){return this.__wrapped__+""},e.prototype.value=J,e.prototype.valueOf=J,Xt(["join","pop","shift"],function(n){var t=nt[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Xt(["push","reverse","sort","unshift"],function(n){var t=nt[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Xt(["concat","slice","splice"],function(n){var t=nt[n];e.prototype[n]=function(){return new e(t.apply(this.__wrapped__,arguments)) -}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=e,define(function(){return e})):X?Y?(Y.exports=e)._=e:X._=e:n._=e})(this); \ No newline at end of file +;(function(n,r){function t(n){return n&&"object"==typeof n&&n.__wrapped__?n:this instanceof t?(this.__wrapped__=n,r):new t(n)}function e(n,r,t){r||(r=0);var e=n.length,u=e-r>=(t||ut);if(u)for(var a={},o=r-1;++o-1}return sr(n,t,r)>-1}}function u(n){return n.charCodeAt(0)}function a(n,r){var t=n.index,e=r.index;if(n=n.criteria,r=r.criteria,n!==r){if(n>r||"undefined"==typeof n)return 1; +if(n-1:r}),l}function I(n){return It(n)&&!Et(parseFloat(n))}function E(n){return"function"==typeof n}function S(n){return n?Jt[typeof n]:!1}function L(n){return T(n)&&n!=+n}function R(n){return null===n}function T(n){return"number"==typeof n||At.call(n)==qt}function F(n){return n instanceof RegExp||At.call(n)==Ht}function N(n){return"string"==typeof n||At.call(n)==Ct}function $(n){return"undefined"==typeof n}function P(n,r,t){var e=arguments,u=0,a=2; +if(!S(n))return n;if(t===et)var o=e[3],f=e[4],l=e[5];else f=[],l=[],"number"!=typeof t&&(a=e.length),a>3&&"function"==typeof e[a-2]?o=i(e[--a-1],e[a--],2):a>2&&"function"==typeof e[a-1]&&(o=e[--a]);for(;++u-1:ne(n,function(n){return++ua&&(a=l)}else r=!r&&N(n)?u:i(r,t),ne(n,function(n,t,u){var o=r(n,t,u); +o>e&&(e=o,a=n)});return a}function Y(n,r,t){var e=1/0,a=e;if(!r&&ee(n))for(var o=-1,f=n.length;++o=100,f=[],l=f;n:for(;++a>>1;t(n[o])=75;if(l)var c={};for(t&&(f=[],t=i(t,e));++u2?kt.call.apply(kt,arguments):o(n,r,p(arguments,2))}function Or(n){for(var r=bt.apply(nt,arguments),t=r.length>1?0:(r=b(n),-1),e=r.length;++t0?o||(o=setTimeout(t,l)):(clearTimeout(o),o=null,i=f,u=n.apply(a,e)),u}}function Dr(n,r){return function(){var t=[n]; +return jt.apply(t,arguments),r.apply(this,t)}}function qr(n){return null==n?"":(n+"").replace(yt,c)}function Br(n){return n}function Hr(n){G(b(n),function(r){var e=t[r]=n[r];t.prototype[r]=function(){var n=[this.__wrapped__];return jt.apply(n,arguments),new t(e.apply(t,n))}})}function Cr(){return n._=at,this}function Kr(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r&&(r=n,n=0),n+_t(Tt()*((+r||0)-n+1))}function Mr(n,t){var e=n?n[t]:r;return E(e)?n[t]():e}function zr(n,e,u){var a=t.templateSettings; +n||(n=""),u=fe({},u,a);var o,i=fe({},u.imports,a.imports),f=ue(i),c=H(i),s=0,p=u.interpolate||vt,g="__p += '",v=RegExp((u.escape||vt).source+"|"+p.source+"|"+(p===gt?pt:vt).source+"|"+(u.evaluate||vt).source+"|$","g");n.replace(v,function(r,t,e,u,a,i){return e||(e=u),g+=n.slice(s,i).replace(ht,l),t&&(g+="' +\n__e("+t+") +\n'"),a&&(o=!0,g+="';\n"+a+";\n__p += '"),e&&(g+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),s=i+r.length,r}),g+="';\n";var y=u.variable,h=y;h||(y="obj",g="with ("+y+") {\n"+g+"\n}\n"),g=(o?g.replace(it,""):g).replace(ft,"$1").replace(lt,"$1;"),g="function("+y+") {\n"+(h?"":y+" || ("+y+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+g+"return __p\n}"; +var d="\n/*\n//@ sourceURL="+(u.sourceURL||"/lodash/template/source["+dt++ +"]")+"\n*/";try{var m=Function(f,"return "+g+d).apply(r,c)}catch(b){throw b.source=g,b}return e?m(e):(m.source=g,m)}function Ur(n,r,t){n=+n||0;for(var e=-1,u=Array(n);++e/g,vt=/($^)/,yt=/[&<>"']/g,ht=/['\n\r\t\u2028\u2029\\]/g,dt=0,mt=Math.ceil,bt=nt.concat,_t=Math.floor,xt=st.test(xt=Object.getPrototypeOf)&&xt,wt=rt.hasOwnProperty,jt=nt.push,At=rt.toString,kt=st.test(kt=p.bind)&&kt,Ot=st.test(Ot=Array.isArray)&&Ot,It=n.isFinite,Et=n.isNaN,St=st.test(St=Object.keys)&&St,Lt=Math.max,Rt=Math.min,Tt=Math.random,Ft="[object Arguments]",Nt="[object Array]",$t="[object Boolean]",Pt="[object Date]",Dt="[object Function]",qt="[object Number]",Bt="[object Object]",Ht="[object RegExp]",Ct="[object String]",Kt=!!n.attachEvent,Mt=kt&&!/\n|true/.test(kt+Kt),zt=kt&&!Mt,Ut=St&&(Kt||Mt),Vt={}; +Vt[Dt]=!1,Vt[Ft]=Vt[Nt]=Vt[$t]=Vt[Pt]=Vt[qt]=Vt[Bt]=Vt[Ht]=Vt[Ct]=!0;var Gt={};Gt[Nt]=Array,Gt[$t]=Boolean,Gt[Pt]=Date,Gt[Bt]=Object,Gt[qt]=Number,Gt[Ht]=RegExp,Gt[Ct]=String;var Jt={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Qt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};t.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:gt,variable:"",imports:{_:t}};var Wt=function(n){var r="var index, iterable = "+n.firstArg+", result = iterable;\nif (!iterable) return result;\n"+n.top+";\n"; +return n.arrays&&(r+="var length = iterable.length; index = -1;\nif ("+n.arrays+") {\n while (++index < length) {\n "+n.loop+"\n }\n}\nelse { "),n.isKeysFast&&n.useHas?r+="\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] ? nativeKeys(iterable) : [],\n length = ownProps.length;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n "+n.loop+"\n } ":(r+="\n for (index in iterable) {",n.useHas&&(r+="\n if (",n.useHas&&(r+="hasOwnProperty.call(iterable, index)"),r+=") { "),r+=n.loop+"; ",n.useHas&&(r+="\n }"),r+="\n } "),n.arrays&&(r+="\n}"),r+=n.bottom+";\nreturn result" +},Xt={args:"object, source, guard",top:"var args = arguments,\n argsIndex = 0,\n argsLength = typeof guard == 'number' ? 2 : args.length;\nwhile (++argsIndex < argsLength) {\n iterable = args[argsIndex];\n if (iterable && objectTypes[typeof iterable]) {",loop:"if (typeof result[index] == 'undefined') result[index] = iterable[index]",bottom:" }\n}"},Yt={args:"collection, callback, thisArg",top:"callback = callback && typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg)",arrays:"typeof length == 'number'",loop:"if (callback(iterable[index], index, collection) === false) return result"},Zt={top:"if (!objectTypes[typeof iterable]) return result;\n"+Yt.top,arrays:!1},ne=f(Yt),re=f(Yt,Zt,{useHas:!1}),te=f(Yt,Zt),ee=Ot||function(n){return n instanceof Array||At.call(n)==Nt +},ue=St?function(n){return S(n)?St(n):[]}:h,ae={"&":"&","<":"<",">":">",'"':""","'":"'"},oe=x(ae),ie=f(Xt,{top:Xt.top.replace(";",";\nif (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n callback = args[--argsLength];\n}"),loop:"result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]"}),fe=f(Xt); +E(/x/)&&(E=function(n){return n instanceof Function||At.call(n)==Dt});var le=xt?function(n){if(!n||"object"!=typeof n)return!1;var r=n.valueOf,t="function"==typeof r&&(t=xt(r))&&xt(t);return t?n==t||xt(n)==t&&!v(n):y(n)}:y,ce=W,se=U;Mt&&Yr&&"function"==typeof setImmediate&&(Rr=kr(setImmediate,n)),t.after=Ar,t.assign=ie,t.at=C,t.bind=kr,t.bindAll=Or,t.bindKey=Ir,t.compact=ir,t.compose=Er,t.countBy=M,t.debounce=Sr,t.defaults=fe,t.defer=Rr,t.delay=Lr,t.difference=fr,t.filter=U,t.flatten=cr,t.forEach=G,t.forIn=re,t.forOwn=te,t.functions=b,t.groupBy=J,t.initial=pr,t.intersection=gr,t.invert=x,t.invoke=Q,t.keys=ue,t.map=W,t.max=X,t.memoize=Tr,t.merge=P,t.min=Y,t.object=hr,t.omit=D,t.once=Fr,t.pairs=q,t.partial=Nr,t.partialRight=$r,t.pick=B,t.pluck=ce,t.range=dr,t.reject=rr,t.rest=mr,t.shuffle=tr,t.sortBy=ar,t.tap=Jr,t.throttle=Pr,t.times=Ur,t.toArray=or,t.union=_r,t.uniq=xr,t.values=H,t.where=se,t.without=wr,t.wrap=Dr,t.zip=jr,t.collect=W,t.drop=mr,t.each=G,t.extend=ie,t.methods=b,t.select=U,t.tail=mr,t.unique=xr,Hr(t),t.clone=d,t.cloneDeep=m,t.contains=K,t.escape=qr,t.every=z,t.find=V,t.has=_,t.identity=Br,t.indexOf=sr,t.isArguments=v,t.isArray=ee,t.isBoolean=w,t.isDate=j,t.isElement=A,t.isEmpty=k,t.isEqual=O,t.isFinite=I,t.isFunction=E,t.isNaN=L,t.isNull=R,t.isNumber=T,t.isObject=S,t.isPlainObject=le,t.isRegExp=F,t.isString=N,t.isUndefined=$,t.lastIndexOf=yr,t.mixin=Hr,t.noConflict=Cr,t.random=Kr,t.reduce=Z,t.reduceRight=nr,t.result=Mr,t.size=er,t.some=ur,t.sortedIndex=br,t.template=zr,t.unescape=Vr,t.uniqueId=Gr,t.all=z,t.any=ur,t.detect=V,t.foldl=Z,t.foldr=nr,t.include=K,t.inject=Z,te(t,function(n,r){t.prototype[r]||(t.prototype[r]=function(){var r=[this.__wrapped__]; +return jt.apply(r,arguments),n.apply(t,r)})}),t.first=lr,t.last=vr,t.take=lr,t.head=lr,te(t,function(n,r){t.prototype[r]||(t.prototype[r]=function(r,e){var u=n(this.__wrapped__,r,e);return null==r||e&&"function"!=typeof r?u:new t(u)})}),t.VERSION="1.0.2",t.prototype.toString=Qr,t.prototype.value=Wr,t.prototype.valueOf=Wr,ne(["join","pop","shift"],function(n){var r=nt[n];t.prototype[n]=function(){return r.apply(this.__wrapped__,arguments)}}),ne(["push","reverse","sort","unshift"],function(n){var r=nt[n]; +t.prototype[n]=function(){return r.apply(this.__wrapped__,arguments),this}}),ne(["concat","slice","splice"],function(n){var r=nt[n];t.prototype[n]=function(){return new t(r.apply(this.__wrapped__,arguments))}}),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(n._=t,define(function(){return t})):Xr?Yr?(Yr.exports=t)._=t:Xr._=t:n._=t})(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 516edda036..63d850fe28 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -1,11 +1,11 @@ /** * @license - * Lo-Dash 1.0.1 (Custom Build) + * Lo-Dash 1.0.2 (Custom Build) * Build: `lodash underscore -o ./dist/lodash.underscore.js` * Copyright 2012-2013 The Dojo Foundation * Based on Underscore.js 1.4.4 * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. - * Available under MIT license + * Available under MIT license */ ;(function(window, undefined) { @@ -3806,7 +3806,7 @@ * build and using precompiled templates, or loading Lo-Dash in a sandbox. * * For more information on precompiling templates see: - * http://lodash.com/#custom-builds + * https://lodash.com/#custom-builds * * For more information on Chrome extension sandboxes see: * http://developer.chrome.com/stable/extensions/sandboxingEval.html @@ -4248,7 +4248,7 @@ * @memberOf _ * @type String */ - lodash.VERSION = '1.0.1'; + lodash.VERSION = '1.0.2'; // add functions to `lodash.prototype` mixin(lodash); diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 42897cec28..c648d4656f 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -1,6 +1,6 @@ /** * @license - * Lo-Dash 1.0.1 (Custom Build) lodash.com/license + * Lo-Dash 1.0.2 (Custom Build) lodash.com/license * Build: `lodash underscore -o ./dist/lodash.underscore.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ @@ -30,5 +30,5 @@ var e=-1;t=dt(0,ft((t-n)/r));for(var u=Array(t);++er?dt(0,e+r):bt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=H,u.noConflict=function(){return n._=rt,this},u.random=function(n,t){return n==K&&t==K&&(t=1),n=+n||0,t==K&&(t=n,n=0),n+lt(jt()*((+t||0)-n+1))},u.reduce=q,u.reduceRight=I,u.result=function(n,t){var r=n?n[t]:K;return j(r)?n[t]():r},u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Dt(n).length },u.some=B,u.sortedIndex=P,u.template=function(n,t,r){n||(n=""),r=y({},r,u.templateSettings);var e=0,o="__p+='",i=r.variable;n.replace(RegExp((r.escape||ot).source+"|"+(r.interpolate||ot).source+"|"+(r.evaluate||ot).source+"|$","g"),function(t,r,u,i,a){return o+=n.slice(e,a).replace(at,f),r&&(o+="'+_['escape']("+r+")+'"),i&&(o+="';"+i+";__p+='"),u&&(o+="'+((__t=("+u+"))==null?'':__t)+'"),e=a+t.length,t}),o+="';\n",i||(i="obj",o="with("+i+"||{}){"+o+"}"),o="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}"; try{var a=Function("_","return "+o)(u)}catch(c){throw c.source=o,c}return t?a(t):(a.source=o,a)},u.unescape=function(n){return n==K?"":(n+"").replace(et,s)},u.uniqueId=function(n){var t=++nt+"";return n?n+t:t},u.all=S,u.any=B,u.detect=k,u.foldl=q,u.foldr=I,u.include=O,u.inject=q,u.first=M,u.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=K){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==K||r)return n[u-1];return p(n,dt(0,u-e))}},u.take=M,u.head=M,u.chain=function(n){return n=new u(n),n.__chain__=J,n -},u.VERSION="1.0.1",H(u),u.prototype.chain=function(){return this.__chain__=J,this},u.prototype.value=function(){return this.__wrapped__},e("pop push reverse shift sort splice unshift".split(" "),function(n){var t=Z[n];u.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),Rt&&0===n.length&&delete n[0],this}}),e(["concat","join","slice"],function(n){var t=Z[n];u.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new u(n),n.__chain__=J),n +},u.VERSION="1.0.2",H(u),u.prototype.chain=function(){return this.__chain__=J,this},u.prototype.value=function(){return this.__wrapped__},e("pop push reverse shift sort splice unshift".split(" "),function(n){var t=Z[n];u.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),Rt&&0===n.length&&delete n[0],this}}),e(["concat","join","slice"],function(n){var t=Z[n];u.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new u(n),n.__chain__=J),n }}),Q?X?(X.exports=u)._=u:Q._=u:n._=u})(this); \ No newline at end of file diff --git a/doc/README.md b/doc/README.md index 8e22b33a07..d296f22a4f 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,194 +1,183 @@ -# Lo-Dash v1.0.1 - - +# Lo-Dash v1.0.2 + -## `Arrays` -* [`_.compact`](#_compactarray) -* [`_.difference`](#_differencearray--array1-array2-) -* [`_.drop`](#_restarray--callbackn1-thisarg) -* [`_.first`](#_firstarray--callbackn-thisarg) -* [`_.flatten`](#_flattenarray-shallow) -* [`_.head`](#_firstarray--callbackn-thisarg) -* [`_.indexOf`](#_indexofarray-value--fromindex0) -* [`_.initial`](#_initialarray--callbackn1-thisarg) -* [`_.intersection`](#_intersectionarray1-array2-) -* [`_.last`](#_lastarray--callbackn-thisarg) -* [`_.lastIndexOf`](#_lastindexofarray-value--fromindexarraylength-1) -* [`_.object`](#_objectkeys--values) -* [`_.range`](#_rangestart0-end--step1) -* [`_.rest`](#_restarray--callbackn1-thisarg) -* [`_.sortedIndex`](#_sortedindexarray-value--callbackidentity-thisarg) -* [`_.tail`](#_restarray--callbackn1-thisarg) -* [`_.take`](#_firstarray--callbackn-thisarg) -* [`_.union`](#_unionarray1-array2-) -* [`_.uniq`](#_uniqarray--issortedfalse-callbackidentity-thisarg) -* [`_.unique`](#_uniqarray--issortedfalse-callbackidentity-thisarg) -* [`_.without`](#_withoutarray--value1-value2-) -* [`_.zip`](#_ziparray1-array2-) +## `Arrays` +* `_.compact` +* `_.difference` +* `_.drop` -> `rest` +* `_.first` +* `_.flatten` +* `_.head` -> `first` +* `_.indexOf` +* `_.initial` +* `_.intersection` +* `_.last` +* `_.lastIndexOf` +* `_.object` +* `_.range` +* `_.rest` +* `_.sortedIndex` +* `_.tail` -> `rest` +* `_.take` -> `first` +* `_.union` +* `_.uniq` +* `_.unique` -> `uniq` +* `_.without` +* `_.zip` - ## `Chaining` -* [`_`](#_value) -* [`_.tap`](#_tapvalue-interceptor) -* [`_.prototype.toString`](#_prototypetostring) -* [`_.prototype.value`](#_prototypevalueof) -* [`_.prototype.valueOf`](#_prototypevalueof) +* `_` +* `_.tap` +* `_.prototype.toString` +* `_.prototype.value` -> `valueOf` +* `_.prototype.valueOf` - ## `Collections` -* [`_.all`](#_everycollection--callbackidentity-thisarg) -* [`_.any`](#_somecollection--callbackidentity-thisarg) -* [`_.at`](#_atcollection--index1-index2-) -* [`_.collect`](#_mapcollection--callbackidentity-thisarg) -* [`_.contains`](#_containscollection-target--fromindex0) -* [`_.countBy`](#_countbycollection--callbackidentity-thisarg) -* [`_.detect`](#_findcollection--callbackidentity-thisarg) -* [`_.each`](#_foreachcollection--callbackidentity-thisarg) -* [`_.every`](#_everycollection--callbackidentity-thisarg) -* [`_.filter`](#_filtercollection--callbackidentity-thisarg) -* [`_.find`](#_findcollection--callbackidentity-thisarg) -* [`_.foldl`](#_reducecollection--callbackidentity-accumulator-thisarg) -* [`_.foldr`](#_reducerightcollection--callbackidentity-accumulator-thisarg) -* [`_.forEach`](#_foreachcollection--callbackidentity-thisarg) -* [`_.groupBy`](#_groupbycollection--callbackidentity-thisarg) -* [`_.include`](#_containscollection-target--fromindex0) -* [`_.inject`](#_reducecollection--callbackidentity-accumulator-thisarg) -* [`_.invoke`](#_invokecollection-methodname--arg1-arg2-) -* [`_.map`](#_mapcollection--callbackidentity-thisarg) -* [`_.max`](#_maxcollection--callbackidentity-thisarg) -* [`_.min`](#_mincollection--callbackidentity-thisarg) -* [`_.pluck`](#_pluckcollection-property) -* [`_.reduce`](#_reducecollection--callbackidentity-accumulator-thisarg) -* [`_.reduceRight`](#_reducerightcollection--callbackidentity-accumulator-thisarg) -* [`_.reject`](#_rejectcollection--callbackidentity-thisarg) -* [`_.select`](#_filtercollection--callbackidentity-thisarg) -* [`_.shuffle`](#_shufflecollection) -* [`_.size`](#_sizecollection) -* [`_.some`](#_somecollection--callbackidentity-thisarg) -* [`_.sortBy`](#_sortbycollection--callbackidentity-thisarg) -* [`_.toArray`](#_toarraycollection) -* [`_.where`](#_wherecollection-properties) +* `_.all` -> `every` +* `_.any` -> `some` +* `_.at` +* `_.collect` -> `map` +* `_.contains` +* `_.countBy` +* `_.detect` -> `find` +* `_.each` -> `forEach` +* `_.every` +* `_.filter` +* `_.find` +* `_.foldl` -> `reduce` +* `_.foldr` -> `reduceRight` +* `_.forEach` +* `_.groupBy` +* `_.include` -> `contains` +* `_.inject` -> `reduce` +* `_.invoke` +* `_.map` +* `_.max` +* `_.min` +* `_.pluck` +* `_.reduce` +* `_.reduceRight` +* `_.reject` +* `_.select` -> `filter` +* `_.shuffle` +* `_.size` +* `_.some` +* `_.sortBy` +* `_.toArray` +* `_.where` - ## `Functions` -* [`_.after`](#_aftern-func) -* [`_.bind`](#_bindfunc--thisarg-arg1-arg2-) -* [`_.bindAll`](#_bindallobject--methodname1-methodname2-) -* [`_.bindKey`](#_bindkeyobject-key--arg1-arg2-) -* [`_.compose`](#_composefunc1-func2-) -* [`_.debounce`](#_debouncefunc-wait-immediate) -* [`_.defer`](#_deferfunc--arg1-arg2-) -* [`_.delay`](#_delayfunc-wait--arg1-arg2-) -* [`_.memoize`](#_memoizefunc--resolver) -* [`_.once`](#_oncefunc) -* [`_.partial`](#_partialfunc--arg1-arg2-) -* [`_.partialRight`](#_partialrightfunc--arg1-arg2-) -* [`_.throttle`](#_throttlefunc-wait) -* [`_.wrap`](#_wrapvalue-wrapper) +* `_.after` +* `_.bind` +* `_.bindAll` +* `_.bindKey` +* `_.compose` +* `_.debounce` +* `_.defer` +* `_.delay` +* `_.memoize` +* `_.once` +* `_.partial` +* `_.partialRight` +* `_.throttle` +* `_.wrap` - ## `Objects` -* [`_.assign`](#_assignobject--source1-source2--callback-thisarg) -* [`_.clone`](#_clonevalue--deepfalse-callback-thisarg) -* [`_.cloneDeep`](#_clonedeepvalue--callback-thisarg) -* [`_.defaults`](#_defaultsobject--source1-source2-) -* [`_.extend`](#_assignobject--source1-source2--callback-thisarg) -* [`_.forIn`](#_forinobject--callbackidentity-thisarg) -* [`_.forOwn`](#_forownobject--callbackidentity-thisarg) -* [`_.functions`](#_functionsobject) -* [`_.has`](#_hasobject-property) -* [`_.invert`](#_invertobject) -* [`_.isArguments`](#_isargumentsvalue) -* [`_.isArray`](#_isarrayvalue) -* [`_.isBoolean`](#_isbooleanvalue) -* [`_.isDate`](#_isdatevalue) -* [`_.isElement`](#_iselementvalue) -* [`_.isEmpty`](#_isemptyvalue) -* [`_.isEqual`](#_isequala-b--callback-thisarg) -* [`_.isFinite`](#_isfinitevalue) -* [`_.isFunction`](#_isfunctionvalue) -* [`_.isNaN`](#_isnanvalue) -* [`_.isNull`](#_isnullvalue) -* [`_.isNumber`](#_isnumbervalue) -* [`_.isObject`](#_isobjectvalue) -* [`_.isPlainObject`](#_isplainobjectvalue) -* [`_.isRegExp`](#_isregexpvalue) -* [`_.isString`](#_isstringvalue) -* [`_.isUndefined`](#_isundefinedvalue) -* [`_.keys`](#_keysobject) -* [`_.merge`](#_mergeobject--source1-source2--callback-thisarg) -* [`_.methods`](#_functionsobject) -* [`_.omit`](#_omitobject-callback-prop1-prop2--thisarg) -* [`_.pairs`](#_pairsobject) -* [`_.pick`](#_pickobject-callback-prop1-prop2--thisarg) -* [`_.values`](#_valuesobject) +* `_.assign` +* `_.clone` +* `_.cloneDeep` +* `_.defaults` +* `_.extend` -> `assign` +* `_.forIn` +* `_.forOwn` +* `_.functions` +* `_.has` +* `_.invert` +* `_.isArguments` +* `_.isArray` +* `_.isBoolean` +* `_.isDate` +* `_.isElement` +* `_.isEmpty` +* `_.isEqual` +* `_.isFinite` +* `_.isFunction` +* `_.isNaN` +* `_.isNull` +* `_.isNumber` +* `_.isObject` +* `_.isPlainObject` +* `_.isRegExp` +* `_.isString` +* `_.isUndefined` +* `_.keys` +* `_.merge` +* `_.methods` -> `functions` +* `_.omit` +* `_.pairs` +* `_.pick` +* `_.values` - ## `Utilities` -* [`_.escape`](#_escapestring) -* [`_.identity`](#_identityvalue) -* [`_.mixin`](#_mixinobject) -* [`_.noConflict`](#_noconflict) -* [`_.random`](#_randommin0-max1) -* [`_.result`](#_resultobject-property) -* [`_.template`](#_templatetext-data-options) -* [`_.times`](#_timesn-callback--thisarg) -* [`_.unescape`](#_unescapestring) -* [`_.uniqueId`](#_uniqueidprefix) +* `_.escape` +* `_.identity` +* `_.mixin` +* `_.noConflict` +* `_.random` +* `_.result` +* `_.template` +* `_.times` +* `_.unescape` +* `_.uniqueId` - ## `Methods` -* [`_.templateSettings.imports._`](#_templatesettingsimports_) +* `_.templateSettings.imports._` - ## `Properties` -* [`_.VERSION`](#_version) -* [`_.templateSettings`](#_templatesettings) -* [`_.templateSettings.escape`](#_templatesettingsescape) -* [`_.templateSettings.evaluate`](#_templatesettingsevaluate) -* [`_.templateSettings.interpolate`](#_templatesettingsinterpolate) -* [`_.templateSettings.variable`](#_templatesettingsvariable) -* [`_.templateSettings.imports`](#_templatesettingsimports) +* `_.VERSION` +* `_.templateSettings` +* `_.templateSettings.escape` +* `_.templateSettings.evaluate` +* `_.templateSettings.imports` +* `_.templateSettings.interpolate` +* `_.templateSettings.variable` - - - - + @@ -197,65 +186,72 @@ ### `_.compact(array)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3166 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3166 "View in source") [Ⓣ][1] -Creates an array with all falsey values of `array` removed. The values `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey. +Creates an array with all falsey values of `array` removed. The values +`false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey. #### Arguments 1. `array` *(Array)*: The array to compact. #### Returns -*(Array)*: Returns a new filtered array. +*(Array)*: Returns a new filtered array. #### Example ```js _.compact([0, 1, false, 2, '', 3]); // => [1, 2, 3] ``` - * * * - -### `_.difference(array [, array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3196 "View in source") [Ⓣ][1] +### `_.difference(array, [array1, array2, ...])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3196 "View in source") [Ⓣ][1] -Creates an array of `array` elements not present in the other arrays using strict equality for comparisons, i.e. `===`. +Creates an array of `array` elements not present in the other arrays +using strict equality for comparisons, i.e. `===`. #### Arguments 1. `array` *(Array)*: The array to process. 2. `[array1, array2, ...]` *(Array)*: Arrays to check. #### Returns -*(Array)*: Returns a new array of `array` elements not present in the other arrays. +*(Array)*: Returns a new array of `array` elements not present in the +other arrays. #### Example ```js _.difference([1, 2, 3, 4, 5], [5, 2, 10]); // => [1, 3, 4] ``` - * * * - -### `_.first(array [, callback|n, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3268 "View in source") [Ⓣ][1] - -Gets the first element of the `array`. If a number `n` is passed, the first `n` elements of the `array` are returned. If a `callback` function is passed, the first elements the `callback` returns truthy for are returned. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. +### `_.first(array, [callback|n], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3268 "View in source") [Ⓣ][1] -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Gets the first element of the `array`. If a number `n` is passed, the first +`n` elements of the `array` are returned. If a `callback` function is passed, +the first elements the `callback` returns truthy for are returned. The `callback` +is bound to `thisArg` and invoked with three arguments; (value, index, array). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Aliases -*head, take* +*_.head, _.take* #### Arguments 1. `array` *(Array)*: The array to query. @@ -263,7 +259,7 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Mixed)*: Returns the first element(s) of `array`. +*(Mixed)*: Returns the first element(s) of `array`. #### Example ```js @@ -297,25 +293,24 @@ var food = [ _.first(food, { 'type': 'fruit' }); // => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }] ``` - * * * - ### `_.flatten(array, shallow)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3307 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3307 "View in source") [Ⓣ][1] -Flattens a nested array *(the nesting can be to any depth)*. If `shallow` is truthy, `array` will only be flattened a single level. +Flattens a nested array (the nesting can be to any depth). If `shallow` is +truthy, `array` will only be flattened a single level. #### Arguments 1. `array` *(Array)*: The array to compact. 2. `shallow` *(Boolean)*: A flag to indicate only flattening a single level. #### Returns -*(Array)*: Returns a new flattened array. +*(Array)*: Returns a new flattened array. #### Example ```js @@ -325,18 +320,18 @@ _.flatten([1, [2], [3, [[4]]]]); _.flatten([1, [2], [3, [[4]]]], true); // => [1, 2, 3, [[4]]]; ``` - * * * - -### `_.indexOf(array, value [, fromIndex=0])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3349 "View in source") [Ⓣ][1] +### `_.indexOf(array, value, [fromIndex=0])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3349 "View in source") [Ⓣ][1] -Gets the index at which the first occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `fromIndex` will run a faster binary search. +Gets the index at which the first occurrence of `value` is found using +strict equality for comparisons, i.e. `===`. If the `array` is already +sorted, passing `true` for `fromIndex` will run a faster binary search. #### Arguments 1. `array` *(Array)*: The array to search. @@ -344,7 +339,7 @@ Gets the index at which the first occurrence of `value` is found using strict eq 3. `[fromIndex=0]` *(Boolean|Number)*: The index to search from or `true` to perform a binary search on a sorted `array`. #### Returns -*(Number)*: Returns the index of the matched value or `-1`. +*(Number)*: Returns the index of the matched value or `-1`. #### Example ```js @@ -357,22 +352,29 @@ _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); _.indexOf([1, 1, 2, 2, 3, 3], 2, true); // => 2 ``` - * * * - -### `_.initial(array [, callback|n=1, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3423 "View in source") [Ⓣ][1] - -Gets all but the last element of `array`. If a number `n` is passed, the last `n` elements are excluded from the result. If a `callback` function is passed, the last elements the `callback` returns truthy for are excluded from the result. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. +### `_.initial(array, [callback|n=1], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3423 "View in source") [Ⓣ][1] -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Gets all but the last element of `array`. If a number `n` is passed, the +last `n` elements are excluded from the result. If a `callback` function +is passed, the last elements the `callback` returns truthy for are excluded +from the result. The `callback` is bound to `thisArg` and invoked with three +arguments; (value, index, array). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Arguments 1. `array` *(Array)*: The array to query. @@ -380,7 +382,7 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Array)*: Returns a slice of `array`. +*(Array)*: Returns a slice of `array`. #### Example ```js @@ -414,46 +416,54 @@ var food = [ _.initial(food, { 'type': 'vegetable' }); // => [{ 'name': 'banana', 'type': 'fruit' }] ``` - * * * - ### `_.intersection([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3457 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3457 "View in source") [Ⓣ][1] -Computes the intersection of all the passed-in arrays using strict equality for comparisons, i.e. `===`. +Computes the intersection of all the passed-in arrays using strict equality +for comparisons, i.e. `===`. #### Arguments 1. `[array1, array2, ...]` *(Array)*: Arrays to process. #### Returns -*(Array)*: Returns a new array of unique elements that are present in **all** of the arrays. +*(Array)*: Returns a new array of unique elements that are present +in **all** of the arrays. #### Example ```js _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); // => [1, 2] ``` - * * * - -### `_.last(array [, callback|n, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3548 "View in source") [Ⓣ][1] - -Gets the last element of the `array`. If a number `n` is passed, the last `n` elements of the `array` are returned. If a `callback` function is passed, the last elements the `callback` returns truthy for are returned. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. +### `_.last(array, [callback|n], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3548 "View in source") [Ⓣ][1] - If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Gets the last element of the `array`. If a number `n` is passed, the last +`n` elements of the `array` are returned. If a `callback` function is passed, +the last elements the `callback` returns truthy for are returned. The `callback` +is bound to `thisArg` and invoked with three arguments; (value, index, array). +
+
+
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Arguments 1. `array` *(Array)*: The array to query. @@ -461,7 +471,7 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Mixed)*: Returns the last element(s) of `array`. +*(Mixed)*: Returns the last element(s) of `array`. #### Example ```js @@ -495,18 +505,18 @@ var food = [ _.last(food, { 'type': 'vegetable' }); // => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }] ``` - * * * - -### `_.lastIndexOf(array, value [, fromIndex=array.length-1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3589 "View in source") [Ⓣ][1] +### `_.lastIndexOf(array, value, [fromIndex=array.length-1])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3589 "View in source") [Ⓣ][1] -Gets the index at which the last occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection. +Gets the index at which the last occurrence of `value` is found using strict +equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used +as the offset from the end of the collection. #### Arguments 1. `array` *(Array)*: The array to search. @@ -514,7 +524,7 @@ Gets the index at which the last occurrence of `value` is found using strict equ 3. `[fromIndex=array.length-1]` *(Number)*: The index to search from. #### Returns -*(Number)*: Returns the index of the matched value or `-1`. +*(Number)*: Returns the index of the matched value or `-1`. #### Example ```js @@ -524,43 +534,43 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); // => 1 ``` - * * * - -### `_.object(keys [, values=[]])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3619 "View in source") [Ⓣ][1] +### `_.object(keys, [values=[]])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3619 "View in source") [Ⓣ][1] -Creates an object composed from arrays of `keys` and `values`. Pass either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or two arrays, one of `keys` and one of corresponding `values`. +Creates an object composed from arrays of `keys` and `values`. Pass either +a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or +two arrays, one of `keys` and one of corresponding `values`. #### Arguments 1. `keys` *(Array)*: The array of keys. 2. `[values=[]]` *(Array)*: The array of values. #### Returns -*(Object)*: Returns an object composed of the given keys and corresponding values. +*(Object)*: Returns an object composed of the given keys and +corresponding values. #### Example ```js _.object(['moe', 'larry'], [30, 40]); // => { 'moe': 30, 'larry': 40 } ``` - * * * - -### `_.range([start=0], end [, step=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3663 "View in source") [Ⓣ][1] +### `_.range([start=0], end, [step=1])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3663 "View in source") [Ⓣ][1] -Creates an array of numbers *(positive and/or negative)* progressing from `start` up to but not including `end`. +Creates an array of numbers (positive and/or negative) progressing from +`start` up to but not including `end`. #### Arguments 1. `[start=0]` *(Number)*: The start of the range. @@ -568,7 +578,7 @@ Creates an array of numbers *(positive and/or negative)* progressing from `start 3. `[step=1]` *(Number)*: The value to increment or descrement by. #### Returns -*(Array)*: Returns a new range array. +*(Array)*: Returns a new range array. #### Example ```js @@ -587,25 +597,32 @@ _.range(0, -10, -1); _.range(0); // => [] ``` - * * * - -### `_.rest(array [, callback|n=1, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3741 "View in source") [Ⓣ][1] +### `_.rest(array, [callback|n=1], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3741 "View in source") [Ⓣ][1] -The opposite of `_.initial`, this method gets all but the first value of `array`. If a number `n` is passed, the first `n` values are excluded from the result. If a `callback` function is passed, the first elements the `callback` returns truthy for are excluded from the result. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +The opposite of `_.initial`, this method gets all but the first value of `array`. +If a number `n` is passed, the first `n` values are excluded from the result. +If a `callback` function is passed, the first elements the `callback` returns +truthy for are excluded from the result. The `callback` is bound to `thisArg` +and invoked with three arguments; (value, index, array). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Aliases -*drop, tail* +*_.drop, _.tail* #### Arguments 1. `array` *(Array)*: The array to query. @@ -613,7 +630,7 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Array)*: Returns a slice of `array`. +*(Array)*: Returns a slice of `array`. #### Example ```js @@ -647,22 +664,29 @@ var food = [ _.rest(food, { 'type': 'fruit' }); // => [{ 'name': 'beet', 'type': 'vegetable' }] ``` - * * * - -### `_.sortedIndex(array, value [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3805 "View in source") [Ⓣ][1] +### `_.sortedIndex(array, value, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3805 "View in source") [Ⓣ][1] -Uses a binary search to determine the smallest index at which the `value` should be inserted into `array` in order to maintain the sort order of the sorted `array`. If `callback` is passed, it will be executed for `value` and each element in `array` to compute their sort ranking. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Uses a binary search to determine the smallest index at which the `value` +should be inserted into `array` in order to maintain the sort order of the +sorted `array`. If `callback` is passed, it will be executed for `value` and +each element in `array` to compute their sort ranking. The `callback` is +bound to `thisArg` and invoked with one argument; (value). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Arguments 1. `array` *(Array)*: The array to iterate over. @@ -671,7 +695,8 @@ If an object is passed for `callback`, the created "_.where" style callback will 4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Number)*: Returns the index at which the value should be inserted into `array`. +*(Number)*: Returns the index at which the value should be inserted +into `array`. #### Example ```js @@ -696,49 +721,56 @@ _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { }, dict); // => 2 ``` - * * * - ### `_.union([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3837 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3837 "View in source") [Ⓣ][1] -Computes the union of the passed-in arrays using strict equality for comparisons, i.e. `===`. +Computes the union of the passed-in arrays using strict equality for +comparisons, i.e. `===`. #### Arguments 1. `[array1, array2, ...]` *(Array)*: Arrays to process. #### Returns -*(Array)*: Returns a new array of unique values, in order, that are present in one or more of the arrays. +*(Array)*: Returns a new array of unique values, in order, that are +present in one or more of the arrays. #### Example ```js _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); // => [1, 2, 3, 101, 10] ``` - * * * - -### `_.uniq(array [, isSorted=false, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3884 "View in source") [Ⓣ][1] - -Creates a duplicate-value-free version of the `array` using strict equality for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` for `isSorted` will run a faster algorithm. If `callback` is passed, each element of `array` is passed through a callback` before uniqueness is computed. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. +### `_.uniq(array, [isSorted=false], [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3884 "View in source") [Ⓣ][1] -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Creates a duplicate-value-free version of the `array` using strict equality +for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` +for `isSorted` will run a faster algorithm. If `callback` is passed, each +element of `array` is passed through a callback` before uniqueness is computed. +The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Aliases -*unique* +*_.unique* #### Arguments 1. `array` *(Array)*: The array to process. @@ -747,7 +779,7 @@ If an object is passed for `callback`, the created "_.where" style callback will 4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Array)*: Returns a duplicate-value-free array. +*(Array)*: Returns a duplicate-value-free array. #### Example ```js @@ -767,64 +799,61 @@ _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math); _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }] ``` - * * * - -### `_.without(array [, value1, value2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3943 "View in source") [Ⓣ][1] +### `_.without(array, [value1, value2, ...])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3943 "View in source") [Ⓣ][1] -Creates an array with all occurrences of the passed values removed using strict equality for comparisons, i.e. `===`. +Creates an array with all occurrences of the passed values removed using +strict equality for comparisons, i.e. `===`. #### Arguments 1. `array` *(Array)*: The array to filter. 2. `[value1, value2, ...]` *(Mixed)*: Values to remove. #### Returns -*(Array)*: Returns a new filtered array. +*(Array)*: Returns a new filtered array. #### Example ```js _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); // => [2, 3, 4] ``` - * * * - ### `_.zip([array1, array2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3974 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3974 "View in source") [Ⓣ][1] -Groups the elements of each array at their corresponding indexes. Useful for separate data sources that are coordinated through matching array indexes. For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix in a similar fashion. +Groups the elements of each array at their corresponding indexes. Useful for +separate data sources that are coordinated through matching array indexes. +For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix +in a similar fashion. #### Arguments 1. `[array1, array2, ...]` *(Array)*: Arrays to process. #### Returns -*(Array)*: Returns a new array of grouped elements. +*(Array)*: Returns a new array of grouped elements. #### Example ```js _.zip(['moe', 'larry'], [30, 40], [true, false]); // => [['moe', 30, true], ['larry', 40, false]] ``` - * * * - - ## `“Chaining” Methods` @@ -832,45 +861,65 @@ _.zip(['moe', 'larry'], [30, 40], [true, false]); ### `_(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L272 "View in source") [Ⓣ][1] - -Creates a `lodash` object, that wraps the given `value`, to enable method chaining. +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L272 "View in source") [Ⓣ][1] +Creates a `lodash` object, that wraps the given `value`, to enable method +chaining. +
+
In addition to Lo-Dash methods, wrappers also have the following `Array` methods:
-`concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, and `unshift` - +`concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, +and `unshift` +
+
The chainable wrapper functions are:
-`after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, `compose`, `concat`, `countBy`, `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, `forEach`, `forIn`, `forOwn`, `functions`, `groupBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `values`, `where`, `without`, `wrap`, and `zip` - +`after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, `compose`, +`concat`, `countBy`, `debounce`, `defaults`, `defer`, `delay`, `difference`, +`filter`, `flatten`, `forEach`, `forIn`, `forOwn`, `functions`, `groupBy`, +`initial`, `intersection`, `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, +`merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `partialRight`, +`pick`, `pluck`, `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`, +`slice`, `sort`, `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, +`union`, `uniq`, `unshift`, `values`, `where`, `without`, `wrap`, and `zip` +
+
The non-chainable wrapper functions are:
-`clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, `lastIndexOf`, `mixin`, `noConflict`, `pop`, `random`, `reduce`, `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `template`, `unescape`, and `uniqueId` - -The wrapper functions `first` and `last` return wrapped values when `n` is passed, otherwise they return unwrapped values. +`clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, `identity`, +`indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, +`isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, `isObject`, +`isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, `lastIndexOf`, +`mixin`, `noConflict`, `pop`, `random`, `reduce`, `reduceRight`, `result`, +`shift`, `size`, `some`, `sortedIndex`, `template`, `unescape`, and `uniqueId` +
+
+The wrapper functions `first` and `last` return wrapped values when `n` is +passed, otherwise they return unwrapped values. #### Arguments 1. `value` *(Mixed)*: The value to wrap in a `lodash` instance. #### Returns -*(Object)*: Returns a `lodash` instance. +*(Object)*: Returns a `lodash` instance. * * * - ### `_.tap(value, interceptor)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4874 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4874 "View in source") [Ⓣ][1] -Invokes `interceptor` with the `value` as the first argument, and then returns `value`. The purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain. +Invokes `interceptor` with the `value` as the first argument, and then +returns `value`. The purpose of this method is to "tap into" a method chain, +in order to perform operations on intermediate results within the chain. #### Arguments 1. `value` *(Mixed)*: The value to pass to `interceptor`. 2. `interceptor` *(Function)*: The function to invoke. #### Returns -*(Mixed)*: Returns `value`. +*(Mixed)*: Returns `value`. #### Example ```js @@ -882,77 +931,73 @@ _([1, 2, 3, 4]) // => // [2, 4] (alerted) // => [4, 16] ``` - * * * - ### `_.prototype.toString()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4891 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4891 "View in source") [Ⓣ][1] Produces the `toString` result of the wrapped value. #### Returns -*(String)*: Returns the string result. +*(String)*: Returns the string result. #### Example ```js _([1, 2, 3]).toString(); // => '1,2,3' ``` - * * * - ### `_.prototype.valueOf()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4908 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4908 "View in source") [Ⓣ][1] Extracts the wrapped value. #### Aliases -*value* +*_.prototype.value* #### Returns -*(Mixed)*: Returns the wrapped value. +*(Mixed)*: Returns the wrapped value. #### Example ```js _([1, 2, 3]).valueOf(); // => [1, 2, 3] ``` - * * * - - ## `“Collections” Methods` -### `_.at(collection [, index1, index2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2167 "View in source") [Ⓣ][1] +### `_.at(collection, [index1, index2, ...])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2167 "View in source") [Ⓣ][1] -Creates an array of elements from the specified indexes, or keys, of the `collection`. Indexes may be specified as individual arguments or as arrays of indexes. +Creates an array of elements from the specified indexes, or keys, of the +`collection`. Indexes may be specified as individual arguments or as arrays +of indexes. #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. 2. `[index1, index2, ...]` *(Array|Number|String)*: The indexes of `collection` to retrieve, either as individual arguments or arrays. #### Returns -*(Array)*: Returns a new array of elements corresponding to the provided indexes. +*(Array)*: Returns a new array of elements corresponding to the +provided indexes. #### Example ```js @@ -962,21 +1007,21 @@ _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); _.at(['moe', 'larry', 'curly'], 0, 2); // => ['moe', 'curly'] ``` - * * * - -### `_.contains(collection, target [, fromIndex=0])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2209 "View in source") [Ⓣ][1] +### `_.contains(collection, target, [fromIndex=0])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2209 "View in source") [Ⓣ][1] -Checks if a given `target` element is present in a `collection` using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection. +Checks if a given `target` element is present in a `collection` using strict +equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used +as the offset from the end of the collection. #### Aliases -*include* +*_.include* #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -984,7 +1029,7 @@ Checks if a given `target` element is present in a `collection` using strict equ 3. `[fromIndex=0]` *(Number)*: The index to search from. #### Returns -*(Boolean)*: Returns `true` if the `target` element is found, else `false`. +*(Boolean)*: Returns `true` if the `target` element is found, else `false`. #### Example ```js @@ -1000,22 +1045,28 @@ _.contains({ 'name': 'moe', 'age': 40 }, 'moe'); _.contains('curly', 'ur'); // => true ``` - * * * - -### `_.countBy(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2263 "View in source") [Ⓣ][1] +### `_.countBy(collection, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2263 "View in source") [Ⓣ][1] -Creates an object composed of keys returned from running each element of the `collection` through the given `callback`. The corresponding value of each key is the number of times the key was returned by the `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Creates an object composed of keys returned from running each element of the +`collection` through the given `callback`. The corresponding value of each key +is the number of times the key was returned by the `callback`. The `callback` +is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1023,7 +1074,7 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Object)*: Returns the composed aggregate object. +*(Object)*: Returns the composed aggregate object. #### Example ```js @@ -1036,25 +1087,30 @@ _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); _.countBy(['one', 'two', 'three'], 'length'); // => { '3': 2, '5': 1 } ``` - * * * - -### `_.every(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2315 "View in source") [Ⓣ][1] +### `_.every(collection, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2315 "View in source") [Ⓣ][1] -Checks if the `callback` returns a truthy value for **all** elements of a `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Checks if the `callback` returns a truthy value for **all** elements of a +`collection`. The `callback` is bound to `thisArg` and invoked with three +arguments; (value, index|key, collection). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Aliases -*all* +*_.all* #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1062,7 +1118,8 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Boolean)*: Returns `true` if all elements pass the callback check, else `false`. +*(Boolean)*: Returns `true` if all elements pass the callback check, +else `false`. #### Example ```js @@ -1082,25 +1139,30 @@ _.every(stooges, 'age'); _.every(stooges, { 'age': 50 }); // => false ``` - * * * - -### `_.filter(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2376 "View in source") [Ⓣ][1] - -Examines each element in a `collection`, returning an array of all elements the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. +### `_.filter(collection, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2376 "View in source") [Ⓣ][1] -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Examines each element in a `collection`, returning an array of all elements +the `callback` returns truthy for. The `callback` is bound to `thisArg` and +invoked with three arguments; (value, index|key, collection). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Aliases -*select* +*_.select* #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1108,7 +1170,7 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Array)*: Returns a new array of elements that passed the callback check. +*(Array)*: Returns a new array of elements that passed the callback check. #### Example ```js @@ -1128,25 +1190,30 @@ _.filter(food, 'organic'); _.filter(food, { 'type': 'fruit' }); // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }] ``` - * * * - -### `_.find(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2443 "View in source") [Ⓣ][1] - -Examines each element in a `collection`, returning the first that the `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. +### `_.find(collection, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2443 "View in source") [Ⓣ][1] -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Examines each element in a `collection`, returning the first that the `callback` +returns truthy for. The `callback` is bound to `thisArg` and invoked with three +arguments; (value, index|key, collection). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Aliases -*detect* +*_.detect* #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1154,7 +1221,8 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Mixed)*: Returns the element that passed the callback check, else `undefined`. +*(Mixed)*: Returns the element that passed the callback check, +else `undefined`. #### Example ```js @@ -1176,21 +1244,22 @@ var veggie = _.find(food, { 'type': 'vegetable' }); var healthy = _.find(food, 'organic'); // => { 'name': 'banana', 'organic': true, 'type': 'fruit' } ``` - * * * - -### `_.forEach(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2478 "View in source") [Ⓣ][1] +### `_.forEach(collection, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2478 "View in source") [Ⓣ][1] -Iterates over a `collection`, executing the `callback` for each element in the `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. Callbacks may exit iteration early by explicitly returning `false`. +Iterates over a `collection`, executing the `callback` for each element in +the `collection`. The `callback` is bound to `thisArg` and invoked with three +arguments; (value, index|key, collection). Callbacks may exit iteration early +by explicitly returning `false`. #### Aliases -*each* +*_.each* #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1198,7 +1267,7 @@ Iterates over a `collection`, executing the `callback` for each element in the ` 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Array, Object, String)*: Returns `collection`. +*(Array|Object|String)*: Returns `collection`. #### Example ```js @@ -1208,22 +1277,28 @@ _([1, 2, 3]).forEach(alert).join(','); _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert); // => alerts each number value (order is not guaranteed) ``` - * * * - -### `_.groupBy(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2528 "View in source") [Ⓣ][1] +### `_.groupBy(collection, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2528 "View in source") [Ⓣ][1] -Creates an object composed of keys returned from running each element of the `collection` through the `callback`. The corresponding value of each key is an array of elements passed to `callback` that returned the key. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false` +Creates an object composed of keys returned from running each element of the +`collection` through the `callback`. The corresponding value of each key is +an array of elements passed to `callback` that returned the key. The `callback` +is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false` #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1231,7 +1306,7 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Object)*: Returns the composed aggregate object. +*(Object)*: Returns the composed aggregate object. #### Example ```js @@ -1245,18 +1320,19 @@ _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); _.groupBy(['one', 'two', 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] } ``` - * * * - -### `_.invoke(collection, methodName [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2561 "View in source") [Ⓣ][1] +### `_.invoke(collection, methodName, [arg1, arg2, ...])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2561 "View in source") [Ⓣ][1] -Invokes the method named by `methodName` on each element in the `collection`, returning an array of the results of each invoked method. Additional arguments will be passed to each invoked method. If `methodName` is a function, it will be invoked for, and `this` bound to, each element in the `collection`. +Invokes the method named by `methodName` on each element in the `collection`, +returning an array of the results of each invoked method. Additional arguments +will be passed to each invoked method. If `methodName` is a function, it will +be invoked for, and `this` bound to, each element in the `collection`. #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1264,7 +1340,7 @@ Invokes the method named by `methodName` on each element in the `collection`, re 3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to invoke the method with. #### Returns -*(Array)*: Returns a new array of the results of each invoked method. +*(Array)*: Returns a new array of the results of each invoked method. #### Example ```js @@ -1274,25 +1350,30 @@ _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); _.invoke([123, 456], String.prototype.split, ''); // => [['1', '2', '3'], ['4', '5', '6']] ``` - * * * - -### `_.map(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2613 "View in source") [Ⓣ][1] - -Creates an array of values by running each element in the `collection` through the `callback`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. +### `_.map(collection, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2613 "View in source") [Ⓣ][1] -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Creates an array of values by running each element in the `collection` +through the `callback`. The `callback` is bound to `thisArg` and invoked with +three arguments; (value, index|key, collection). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Aliases -*collect* +*_.collect* #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1300,7 +1381,7 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Array)*: Returns a new array of the results of each `callback` execution. +*(Array)*: Returns a new array of the results of each `callback` execution. #### Example ```js @@ -1319,22 +1400,28 @@ var stooges = [ _.map(stooges, 'name'); // => ['moe', 'larry'] ``` - * * * - -### `_.max(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2670 "View in source") [Ⓣ][1] - -Retrieves the maximum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. +### `_.max(collection, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2670 "View in source") [Ⓣ][1] -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Retrieves the maximum value of an `array`. If `callback` is passed, +it will be executed for each value in the `array` to generate the +criterion by which the value is ranked. The `callback` is bound to +`thisArg` and invoked with three arguments; (value, index, collection). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1342,7 +1429,7 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Mixed)*: Returns the maximum value. +*(Mixed)*: Returns the maximum value. #### Example ```js @@ -1361,22 +1448,28 @@ _.max(stooges, function(stooge) { return stooge.age; }); _.max(stooges, 'age'); // => { 'name': 'larry', 'age': 50 }; ``` - * * * - -### `_.min(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2739 "View in source") [Ⓣ][1] - -Retrieves the minimum value of an `array`. If `callback` is passed, it will be executed for each value in the `array` to generate the criterion by which the value is ranked. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. +### `_.min(collection, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2739 "View in source") [Ⓣ][1] -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Retrieves the minimum value of an `array`. If `callback` is passed, +it will be executed for each value in the `array` to generate the +criterion by which the value is ranked. The `callback` is bound to `thisArg` +and invoked with three arguments; (value, index, collection). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1384,7 +1477,7 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Mixed)*: Returns the minimum value. +*(Mixed)*: Returns the minimum value. #### Example ```js @@ -1403,16 +1496,14 @@ _.min(stooges, function(stooge) { return stooge.age; }); _.min(stooges, 'age'); // => { 'name': 'moe', 'age': 40 }; ``` - * * * - ### `_.pluck(collection, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2789 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2789 "View in source") [Ⓣ][1] Retrieves the value of a specified property from all elements in the `collection`. @@ -1421,7 +1512,7 @@ Retrieves the value of a specified property from all elements in the `collection 2. `property` *(String)*: The property to pluck. #### Returns -*(Array)*: Returns a new array of property values. +*(Array)*: Returns a new array of property values. #### Example ```js @@ -1433,21 +1524,24 @@ var stooges = [ _.pluck(stooges, 'name'); // => ['moe', 'larry'] ``` - * * * - -### `_.reduce(collection [, callback=identity, accumulator, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2821 "View in source") [Ⓣ][1] +### `_.reduce(collection, [callback=identity], [accumulator], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2821 "View in source") [Ⓣ][1] -Reduces a `collection` to a value that is the accumulated result of running each element in the `collection` through the `callback`, where each successive `callback` execution consumes the return value of the previous execution. If `accumulator` is not passed, the first element of the `collection` will be used as the initial `accumulator` value. The `callback` is bound to `thisArg` and invoked with four arguments; *(accumulator, value, index|key, collection)*. +Reduces a `collection` to a value that is the accumulated result of running +each element in the `collection` through the `callback`, where each successive +`callback` execution consumes the return value of the previous execution. +If `accumulator` is not passed, the first element of the `collection` will be +used as the initial `accumulator` value. The `callback` is bound to `thisArg` +and invoked with four arguments; (accumulator, value, index|key, collection). #### Aliases -*foldl, inject* +*_.foldl, _.inject* #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1456,7 +1550,7 @@ Reduces a `collection` to a value that is the accumulated result of running each 4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Mixed)*: Returns the accumulated value. +*(Mixed)*: Returns the accumulated value. #### Example ```js @@ -1471,21 +1565,20 @@ var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { }, {}); // => { 'a': 3, 'b': 6, 'c': 9 } ``` - * * * - -### `_.reduceRight(collection [, callback=identity, accumulator, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2864 "View in source") [Ⓣ][1] +### `_.reduceRight(collection, [callback=identity], [accumulator], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2864 "View in source") [Ⓣ][1] -This method is similar to `_.reduce`, except that it iterates over a `collection` from right to left. +This method is similar to `_.reduce`, except that it iterates over a +`collection` from right to left. #### Aliases -*foldr* +*_.foldr* #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1494,7 +1587,7 @@ This method is similar to `_.reduce`, except that it iterates over a `collection 4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Mixed)*: Returns the accumulated value. +*(Mixed)*: Returns the accumulated value. #### Example ```js @@ -1502,22 +1595,26 @@ var list = [[0, 1], [2, 3], [4, 5]]; var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); // => [4, 5, 2, 3, 0, 1] ``` - * * * - -### `_.reject(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2924 "View in source") [Ⓣ][1] - -The opposite of `_.filter`, this method returns the elements of a `collection` that `callback` does **not** return truthy for. - -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. +### `_.reject(collection, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2924 "View in source") [Ⓣ][1] -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +The opposite of `_.filter`, this method returns the elements of a +`collection` that `callback` does **not** return truthy for. +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1525,7 +1622,8 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Array)*: Returns a new array of elements that did **not** pass the callback check. +*(Array)*: Returns a new array of elements that did **not** pass the +callback check. #### Example ```js @@ -1545,48 +1643,46 @@ _.reject(food, 'organic'); _.reject(food, { 'type': 'fruit' }); // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }] ``` - * * * - ### `_.shuffle(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2945 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2945 "View in source") [Ⓣ][1] -Creates an array of shuffled `array` values, using a version of the Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. +Creates an array of shuffled `array` values, using a version of the +Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. #### Arguments 1. `collection` *(Array|Object|String)*: The collection to shuffle. #### Returns -*(Array)*: Returns a new shuffled collection. +*(Array)*: Returns a new shuffled collection. #### Example ```js _.shuffle([1, 2, 3, 4, 5, 6]); // => [4, 1, 6, 3, 5, 2] ``` - * * * - ### `_.size(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2978 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2978 "View in source") [Ⓣ][1] -Gets the size of the `collection` by returning `collection.length` for arrays and array-like objects or the number of own enumerable properties for objects. +Gets the size of the `collection` by returning `collection.length` for arrays +and array-like objects or the number of own enumerable properties for objects. #### Arguments 1. `collection` *(Array|Object|String)*: The collection to inspect. #### Returns -*(Number)*: Returns `collection.length` or number of own enumerable properties. +*(Number)*: Returns `collection.length` or number of own enumerable properties. #### Example ```js @@ -1599,25 +1695,31 @@ _.size({ 'one': 1, 'two': 2, 'three': 3 }); _.size('curly'); // => 5 ``` - * * * - -### `_.some(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3025 "View in source") [Ⓣ][1] - -Checks if the `callback` returns a truthy value for **any** element of a `collection`. The function returns as soon as it finds passing value, and does not iterate over the entire `collection`. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. +### `_.some(collection, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3025 "View in source") [Ⓣ][1] -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Checks if the `callback` returns a truthy value for **any** element of a +`collection`. The function returns as soon as it finds passing value, and +does not iterate over the entire `collection`. The `callback` is bound to +`thisArg` and invoked with three arguments; (value, index|key, collection). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Aliases -*any* +*_.any* #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1625,7 +1727,8 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Boolean)*: Returns `true` if any element passes the callback check, else `false`. +*(Boolean)*: Returns `true` if any element passes the callback check, +else `false`. #### Example ```js @@ -1645,22 +1748,29 @@ _.some(food, 'organic'); _.some(food, { 'type': 'meat' }); // => false ``` - * * * - -### `_.sortBy(collection [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3081 "View in source") [Ⓣ][1] - -Creates an array of elements, sorted in ascending order by the results of running each element in the `collection` through the `callback`. This method performs a stable sort, that is, it will preserve the original sort order of equal elements. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. +### `_.sortBy(collection, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3081 "View in source") [Ⓣ][1] -If a property name is passed for `callback`, the created "_.pluck" style callback will return the property value of the given element. - -If an object is passed for `callback`, the created "_.where" style callback will return `true` for elements that have the propeties of the given object, else `false`. +Creates an array of elements, sorted in ascending order by the results of +running each element in the `collection` through the `callback`. This method +performs a stable sort, that is, it will preserve the original sort order of +equal elements. The `callback` is bound to `thisArg` and invoked with three +arguments; (value, index|key, collection). +
+
+If a property name is passed for `callback`, the created "_.pluck" style +callback will return the property value of the given element. +
+
+If an object is passed for `callback`, the created "_.where" style callback +will return `true` for elements that have the propeties of the given object, +else `false`. #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. @@ -1668,7 +1778,7 @@ If an object is passed for `callback`, the created "_.where" style callback will 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Array)*: Returns a new array of sorted elements. +*(Array)*: Returns a new array of sorted elements. #### Example ```js @@ -1682,16 +1792,14 @@ _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); _.sortBy(['banana', 'strawberry', 'apple'], 'length'); // => ['apple', 'banana', 'strawberry'] ``` - * * * - ### `_.toArray(collection)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3116 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3116 "View in source") [Ⓣ][1] Converts the `collection` to an array. @@ -1699,32 +1807,33 @@ Converts the `collection` to an array. 1. `collection` *(Array|Object|String)*: The collection to convert. #### Returns -*(Array)*: Returns the new converted array. +*(Array)*: Returns the new converted array. #### Example ```js (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); // => [2, 3, 4] ``` - * * * - ### `_.where(collection, properties)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3148 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L3148 "View in source") [Ⓣ][1] -Examines each element in a `collection`, returning an array of all elements that have the given `properties`. When checking `properties`, this method performs a deep comparison between values to determine if they are equivalent to each other. +Examines each element in a `collection`, returning an array of all elements +that have the given `properties`. When checking `properties`, this method +performs a deep comparison between values to determine if they are equivalent +to each other. #### Arguments 1. `collection` *(Array|Object|String)*: The collection to iterate over. 2. `properties` *(Object)*: The object of property values to filter by. #### Returns -*(Array)*: Returns a new array of elements that have the given `properties`. +*(Array)*: Returns a new array of elements that have the given `properties`. #### Example ```js @@ -1736,15 +1845,12 @@ var stooges = [ _.where(stooges, { 'age': 40 }); // => [{ 'name': 'moe', 'age': 40 }] ``` - * * * - - ## `“Functions” Methods` @@ -1752,16 +1858,18 @@ _.where(stooges, { 'age': 40 }); ### `_.after(n, func)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4007 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4007 "View in source") [Ⓣ][1] -Creates a function that is restricted to executing `func` only after it is called `n` times. The `func` is executed with the `this` binding of the created function. +Creates a function that is restricted to executing `func` only after it is +called `n` times. The `func` is executed with the `this` binding of the +created function. #### Arguments 1. `n` *(Number)*: The number of times the function must be called before it is executed. 2. `func` *(Function)*: The function to restrict. #### Returns -*(Function)*: Returns the new restricted function. +*(Function)*: Returns the new restricted function. #### Example ```js @@ -1771,18 +1879,18 @@ _.forEach(notes, function(note) { }); // `renderNotes` is run once, after all notes have saved ``` - * * * - -### `_.bind(func [, thisArg, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4040 "View in source") [Ⓣ][1] +### `_.bind(func, [thisArg], [arg1, arg2, ...])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4040 "View in source") [Ⓣ][1] -Creates a function that, when called, invokes `func` with the `this` binding of `thisArg` and prepends any additional `bind` arguments to those passed to the bound function. +Creates a function that, when called, invokes `func` with the `this` +binding of `thisArg` and prepends any additional `bind` arguments to those +passed to the bound function. #### Arguments 1. `func` *(Function)*: The function to bind. @@ -1790,7 +1898,7 @@ Creates a function that, when called, invokes `func` with the `this` binding of 3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to be partially applied. #### Returns -*(Function)*: Returns the new bound function. +*(Function)*: Returns the new bound function. #### Example ```js @@ -1802,25 +1910,26 @@ func = _.bind(func, { 'name': 'moe' }, 'hi'); func(); // => 'hi moe' ``` - * * * - -### `_.bindAll(object [, methodName1, methodName2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4071 "View in source") [Ⓣ][1] +### `_.bindAll(object, [methodName1, methodName2, ...])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4071 "View in source") [Ⓣ][1] -Binds methods on `object` to `object`, overwriting the existing method. Method names may be specified as individual arguments or as arrays of method names. If no method names are provided, all the function properties of `object` will be bound. +Binds methods on `object` to `object`, overwriting the existing method. +Method names may be specified as individual arguments or as arrays of method +names. If no method names are provided, all the function properties of `object` +will be bound. #### Arguments 1. `object` *(Object)*: The object to bind and assign the bound methods to. 2. `[methodName1, methodName2, ...]` *(String)*: Method names on the object to bind. #### Returns -*(Object)*: Returns `object`. +*(Object)*: Returns `object`. #### Example ```js @@ -1833,18 +1942,20 @@ _.bindAll(view); jQuery('#docs').on('click', view.onClick); // => alerts 'clicked docs', when the button is clicked ``` - * * * - -### `_.bindKey(object, key [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4117 "View in source") [Ⓣ][1] +### `_.bindKey(object, key, [arg1, arg2, ...])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4117 "View in source") [Ⓣ][1] -Creates a function that, when called, invokes the method at `object[key]` and prepends any additional `bindKey` arguments to those passed to the bound function. This method differs from `_.bind` by allowing bound functions to reference methods that will be redefined or don't yet exist. See http://michaux.ca/articles/lazy-function-definition-pattern. +Creates a function that, when called, invokes the method at `object[key]` +and prepends any additional `bindKey` arguments to those passed to the bound +function. This method differs from `_.bind` by allowing bound functions to +reference methods that will be redefined or don't yet exist. +See http://michaux.ca/articles/lazy-function-definition-pattern. #### Arguments 1. `object` *(Object)*: The object the method belongs to. @@ -1852,7 +1963,7 @@ Creates a function that, when called, invokes the method at `object[key]` and pr 3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to be partially applied. #### Returns -*(Function)*: Returns the new bound function. +*(Function)*: Returns the new bound function. #### Example ```js @@ -1874,24 +1985,25 @@ object.greet = function(greeting) { func(); // => 'hi, moe!' ``` - * * * - ### `_.compose([func1, func2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4140 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4140 "View in source") [Ⓣ][1] -Creates a function that is the composition of the passed functions, where each function consumes the return value of the function that follows. For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. Each function is executed with the `this` binding of the composed function. +Creates a function that is the composition of the passed functions, +where each function consumes the return value of the function that follows. +For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. +Each function is executed with the `this` binding of the composed function. #### Arguments 1. `[func1, func2, ...]` *(Function)*: Functions to compose. #### Returns -*(Function)*: Returns the new composed function. +*(Function)*: Returns the new composed function. #### Example ```js @@ -1901,18 +2013,20 @@ var welcome = _.compose(exclaim, greet); welcome('moe'); // => 'hi moe!' ``` - * * * - ### `_.debounce(func, wait, immediate)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4173 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4173 "View in source") [Ⓣ][1] -Creates a function that will delay the execution of `func` until after `wait` milliseconds have elapsed since the last time it was invoked. Pass `true` for `immediate` to cause debounce to invoke `func` on the leading, instead of the trailing, edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call. +Creates a function that will delay the execution of `func` until after +`wait` milliseconds have elapsed since the last time it was invoked. Pass +`true` for `immediate` to cause debounce to invoke `func` on the leading, +instead of the trailing, edge of the `wait` timeout. Subsequent calls to +the debounced function will return the result of the last `func` call. #### Arguments 1. `func` *(Function)*: The function to debounce. @@ -1920,50 +2034,48 @@ Creates a function that will delay the execution of `func` until after `wait` mi 3. `immediate` *(Boolean)*: A flag to indicate execution is on the leading edge of the timeout. #### Returns -*(Function)*: Returns the new debounced function. +*(Function)*: Returns the new debounced function. #### Example ```js var lazyLayout = _.debounce(calculateLayout, 300); jQuery(window).on('resize', lazyLayout); ``` - * * * - -### `_.defer(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4237 "View in source") [Ⓣ][1] +### `_.defer(func, [arg1, arg2, ...])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4237 "View in source") [Ⓣ][1] -Defers executing the `func` function until the current call stack has cleared. Additional arguments will be passed to `func` when it is invoked. +Defers executing the `func` function until the current call stack has cleared. +Additional arguments will be passed to `func` when it is invoked. #### Arguments 1. `func` *(Function)*: The function to defer. 2. `[arg1, arg2, ...]` *(Mixed)*: Arguments to invoke the function with. #### Returns -*(Number)*: Returns the `setTimeout` timeout id. +*(Number)*: Returns the `setTimeout` timeout id. #### Example ```js _.defer(function() { alert('deferred'); }); // returns from the function before `alert` is called ``` - * * * - -### `_.delay(func, wait [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4217 "View in source") [Ⓣ][1] +### `_.delay(func, wait, [arg1, arg2, ...])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4217 "View in source") [Ⓣ][1] -Executes the `func` function after `wait` milliseconds. Additional arguments will be passed to `func` when it is invoked. +Executes the `func` function after `wait` milliseconds. Additional arguments +will be passed to `func` when it is invoked. #### Arguments 1. `func` *(Function)*: The function to delay. @@ -1971,7 +2083,7 @@ Executes the `func` function after `wait` milliseconds. Additional arguments wil 3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to invoke the function with. #### Returns -*(Number)*: Returns the `setTimeout` timeout id. +*(Number)*: Returns the `setTimeout` timeout id. #### Example ```js @@ -1979,25 +2091,27 @@ var log = _.bind(console.log, console); _.delay(log, 1000, 'logged later'); // => 'logged later' (Appears after one second.) ``` - * * * - -### `_.memoize(func [, resolver])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4265 "View in source") [Ⓣ][1] +### `_.memoize(func, [resolver])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4265 "View in source") [Ⓣ][1] -Creates a function that memoizes the result of `func`. If `resolver` is passed, it will be used to determine the cache key for storing the result based on the arguments passed to the memoized function. By default, the first argument passed to the memoized function is used as the cache key. The `func` is executed with the `this` binding of the memoized function. +Creates a function that memoizes the result of `func`. If `resolver` is +passed, it will be used to determine the cache key for storing the result +based on the arguments passed to the memoized function. By default, the first +argument passed to the memoized function is used as the cache key. The `func` +is executed with the `this` binding of the memoized function. #### Arguments 1. `func` *(Function)*: The function to have its output memoized. 2. `[resolver]` *(Function)*: A function used to resolve the cache key. #### Returns -*(Function)*: Returns the new memoizing function. +*(Function)*: Returns the new memoizing function. #### Example ```js @@ -2005,24 +2119,24 @@ var fibonacci = _.memoize(function(n) { return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); }); ``` - * * * - ### `_.once(func)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4292 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4292 "View in source") [Ⓣ][1] -Creates a function that is restricted to execute `func` once. Repeat calls to the function will return the value of the first call. The `func` is executed with the `this` binding of the created function. +Creates a function that is restricted to execute `func` once. Repeat calls to +the function will return the value of the first call. The `func` is executed +with the `this` binding of the created function. #### Arguments 1. `func` *(Function)*: The function to restrict. #### Returns -*(Function)*: Returns the new restricted function. +*(Function)*: Returns the new restricted function. #### Example ```js @@ -2031,25 +2145,25 @@ initialize(); initialize(); // `initialize` executes `createApplication` once ``` - * * * - -### `_.partial(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4327 "View in source") [Ⓣ][1] +### `_.partial(func, [arg1, arg2, ...])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4327 "View in source") [Ⓣ][1] -Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those passed to the new function. This method is similar to `_.bind`, except it does **not** alter the `this` binding. +Creates a function that, when called, invokes `func` with any additional +`partial` arguments prepended to those passed to the new function. This +method is similar to `_.bind`, except it does **not** alter the `this` binding. #### Arguments 1. `func` *(Function)*: The function to partially apply arguments to. 2. `[arg1, arg2, ...]` *(Mixed)*: Arguments to be partially applied. #### Returns -*(Function)*: Returns the new partially applied function. +*(Function)*: Returns the new partially applied function. #### Example ```js @@ -2058,25 +2172,24 @@ var hi = _.partial(greet, 'hi'); hi('moe'); // => 'hi moe' ``` - * * * - -### `_.partialRight(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4358 "View in source") [Ⓣ][1] +### `_.partialRight(func, [arg1, arg2, ...])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4358 "View in source") [Ⓣ][1] -This method is similar to `_.partial`, except that `partial` arguments are appended to those passed to the new function. +This method is similar to `_.partial`, except that `partial` arguments are +appended to those passed to the new function. #### Arguments 1. `func` *(Function)*: The function to partially apply arguments to. 2. `[arg1, arg2, ...]` *(Mixed)*: Arguments to be partially applied. #### Returns -*(Function)*: Returns the new partially applied function. +*(Function)*: Returns the new partially applied function. #### Example ```js @@ -2095,50 +2208,53 @@ options.variable options.imports // => { '_': _, 'jq': $ } ``` - * * * - ### `_.throttle(func, wait)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4380 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4380 "View in source") [Ⓣ][1] -Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. If the throttled function is invoked more than once during the `wait` timeout, `func` will also be called on the trailing edge of the timeout. Subsequent calls to the throttled function will return the result of the last `func` call. +Creates a function that, when executed, will only call the `func` +function at most once per every `wait` milliseconds. If the throttled +function is invoked more than once during the `wait` timeout, `func` will +also be called on the trailing edge of the timeout. Subsequent calls to the +throttled function will return the result of the last `func` call. #### Arguments 1. `func` *(Function)*: The function to throttle. 2. `wait` *(Number)*: The number of milliseconds to throttle executions to. #### Returns -*(Function)*: Returns the new throttled function. +*(Function)*: Returns the new throttled function. #### Example ```js var throttled = _.throttle(updatePosition, 100); jQuery(window).on('scroll', throttled); ``` - * * * - ### `_.wrap(value, wrapper)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4433 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4433 "View in source") [Ⓣ][1] -Creates a function that passes `value` to the `wrapper` function as its first argument. Additional arguments passed to the function are appended to those passed to the `wrapper` function. The `wrapper` is executed with the `this` binding of the created function. +Creates a function that passes `value` to the `wrapper` function as its +first argument. Additional arguments passed to the function are appended +to those passed to the `wrapper` function. The `wrapper` is executed with +the `this` binding of the created function. #### Arguments 1. `value` *(Mixed)*: The value to wrap. 2. `wrapper` *(Function)*: The wrapper function. #### Returns -*(Function)*: Returns the new function. +*(Function)*: Returns the new function. #### Example ```js @@ -2149,28 +2265,29 @@ hello = _.wrap(hello, function(func) { hello(); // => 'before, hello moe, after' ``` - * * * - - ## `“Objects” Methods` -### `_.assign(object [, source1, source2, ..., callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1062 "View in source") [Ⓣ][1] +### `_.assign(object, [source1, source2, ...], [callback], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1062 "View in source") [Ⓣ][1] -Assigns own enumerable properties of source object(s) to the destination object. Subsequent sources will overwrite propery assignments of previous sources. If a `callback` function is passed, it will be executed to produce the assigned values. The `callback` is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*. +Assigns own enumerable properties of source object(s) to the destination +object. Subsequent sources will overwrite propery assignments of previous +sources. If a `callback` function is passed, it will be executed to produce +the assigned values. The `callback` is bound to `thisArg` and invoked with +two arguments; (objectValue, sourceValue). #### Aliases -*extend* +*_.extend* #### Arguments 1. `object` *(Object)*: The destination object. @@ -2179,7 +2296,7 @@ Assigns own enumerable properties of source object(s) to the destination object. 4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Object)*: Returns the destination object. +*(Object)*: Returns the destination object. #### Example ```js @@ -2194,18 +2311,20 @@ var food = { 'name': 'apple' }; defaults(food, { 'name': 'banana', 'type': 'fruit' }); // => { 'name': 'apple', 'type': 'fruit' } ``` - * * * - -### `_.clone(value [, deep=false, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1117 "View in source") [Ⓣ][1] +### `_.clone(value, [deep=false], [callback], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1117 "View in source") [Ⓣ][1] -Creates a clone of `value`. If `deep` is `true`, nested objects will also be cloned, otherwise they will be assigned by reference. If a `callback` function is passed, it will be executed to produce the cloned values. If `callback` returns `undefined`, cloning will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. +Creates a clone of `value`. If `deep` is `true`, nested objects will also +be cloned, otherwise they will be assigned by reference. If a `callback` +function is passed, it will be executed to produce the cloned values. If +`callback` returns `undefined`, cloning will be handled by the method instead. +The `callback` is bound to `thisArg` and invoked with one argument; (value). #### Arguments 1. `value` *(Mixed)*: The value to clone. @@ -2214,7 +2333,7 @@ Creates a clone of `value`. If `deep` is `true`, nested objects will also be clo 4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Mixed)*: Returns the cloned `value`. +*(Mixed)*: Returns the cloned `value`. #### Example ```js @@ -2241,20 +2360,25 @@ var clone = _.clone(document.body); clone.childNodes.length; // => 0 ``` - * * * - -### `_.cloneDeep(value [, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1242 "View in source") [Ⓣ][1] +### `_.cloneDeep(value, [callback], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1242 "View in source") [Ⓣ][1] -Creates a deep clone of `value`. If a `callback` function is passed, it will be executed to produce the cloned values. If `callback` returns the value it was passed, cloning will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with one argument; *(value)*. - -Note: This function is loosely based on the structured clone algorithm. Functions and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and objects created by constructors other than `Object` are cloned to plain `Object` objects. See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. +Creates a deep clone of `value`. If a `callback` function is passed, it will +be executed to produce the cloned values. If `callback` returns the value it +was passed, cloning will be handled by the method instead. The `callback` is +bound to `thisArg` and invoked with one argument; (value). +
+
+Note: This function is loosely based on the structured clone algorithm. Functions +and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and +objects created by constructors other than `Object` are cloned to plain `Object` objects. +See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. #### Arguments 1. `value` *(Mixed)*: The value to deep clone. @@ -2262,7 +2386,7 @@ Note: This function is loosely based on the structured clone algorithm. Function 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Mixed)*: Returns the deep cloned `value`. +*(Mixed)*: Returns the deep cloned `value`. #### Example ```js @@ -2287,25 +2411,25 @@ var clone = _.cloneDeep(view, function(value) { clone.node == view.node; // => false ``` - * * * - -### `_.defaults(object [, source1, source2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1266 "View in source") [Ⓣ][1] +### `_.defaults(object, [source1, source2, ...])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1266 "View in source") [Ⓣ][1] -Assigns own enumerable properties of source object(s) to the destination object for all destination properties that resolve to `undefined`. Once a property is set, additional defaults of the same property will be ignored. +Assigns own enumerable properties of source object(s) to the destination +object for all destination properties that resolve to `undefined`. Once a +property is set, additional defaults of the same property will be ignored. #### Arguments 1. `object` *(Object)*: The destination object. 2. `[source1, source2, ...]` *(Object)*: The source objects. #### Returns -*(Object)*: Returns the destination object. +*(Object)*: Returns the destination object. #### Example ```js @@ -2313,18 +2437,19 @@ var food = { 'name': 'apple' }; _.defaults(food, { 'name': 'banana', 'type': 'fruit' }); // => { 'name': 'apple', 'type': 'fruit' } ``` - * * * - -### `_.forIn(object [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L882 "View in source") [Ⓣ][1] +### `_.forIn(object, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L882 "View in source") [Ⓣ][1] -Iterates over `object`'s own and inherited enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. +Iterates over `object`'s own and inherited enumerable properties, executing +the `callback` for each property. The `callback` is bound to `thisArg` and +invoked with three arguments; (value, key, object). Callbacks may exit iteration +early by explicitly returning `false`. #### Arguments 1. `object` *(Object)*: The object to iterate over. @@ -2332,7 +2457,7 @@ Iterates over `object`'s own and inherited enumerable properties, executing the 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Object)*: Returns `object`. +*(Object)*: Returns `object`. #### Example ```js @@ -2349,18 +2474,19 @@ _.forIn(new Dog('Dagny'), function(value, key) { }); // => alerts 'name' and 'bark' (order is not guaranteed) ``` - * * * - -### `_.forOwn(object [, callback=identity, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L907 "View in source") [Ⓣ][1] +### `_.forOwn(object, [callback=identity], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L907 "View in source") [Ⓣ][1] -Iterates over an object's own enumerable properties, executing the `callback` for each property. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. +Iterates over an object's own enumerable properties, executing the `callback` +for each property. The `callback` is bound to `thisArg` and invoked with three +arguments; (value, key, object). Callbacks may exit iteration early by explicitly +returning `false`. #### Arguments 1. `object` *(Object)*: The object to iterate over. @@ -2368,7 +2494,7 @@ Iterates over an object's own enumerable properties, executing the `callback` fo 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Object)*: Returns `object`. +*(Object)*: Returns `object`. #### Example ```js @@ -2377,68 +2503,64 @@ _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { }); // => alerts '0', '1', and 'length' (order is not guaranteed) ``` - * * * - ### `_.functions(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1283 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1283 "View in source") [Ⓣ][1] -Creates a sorted array of all enumerable properties, own and inherited, of `object` that have function values. +Creates a sorted array of all enumerable properties, own and inherited, +of `object` that have function values. #### Aliases -*methods* +*_.methods* #### Arguments 1. `object` *(Object)*: The object to inspect. #### Returns -*(Array)*: Returns a new array of property names that have function values. +*(Array)*: Returns a new array of property names that have function values. #### Example ```js _.functions(_); // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] ``` - * * * - ### `_.has(object, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1308 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1308 "View in source") [Ⓣ][1] -Checks if the specified object `property` exists and is a direct property, instead of an inherited property. +Checks if the specified object `property` exists and is a direct property, +instead of an inherited property. #### Arguments 1. `object` *(Object)*: The object to check. 2. `property` *(String)*: The property to check for. #### Returns -*(Boolean)*: Returns `true` if key is a direct property, else `false`. +*(Boolean)*: Returns `true` if key is a direct property, else `false`. #### Example ```js _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); // => true ``` - * * * - ### `_.invert(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1325 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1325 "View in source") [Ⓣ][1] Creates an object composed of the inverted keys and values of the given `object`. @@ -2446,23 +2568,21 @@ Creates an object composed of the inverted keys and values of the given `object` 1. `object` *(Object)*: The object to invert. #### Returns -*(Object)*: Returns the created inverted object. +*(Object)*: Returns the created inverted object. #### Example ```js _.invert({ 'first': 'moe', 'second': 'larry' }); // => { 'moe': 'first', 'larry': 'second' } (order is not guaranteed) ``` - * * * - ### `_.isArguments(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L843 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L843 "View in source") [Ⓣ][1] Checks if `value` is an `arguments` object. @@ -2470,7 +2590,7 @@ Checks if `value` is an `arguments` object. 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is an `arguments` object, else `false`. +*(Boolean)*: Returns `true`, if the `value` is an `arguments` object, else `false`. #### Example ```js @@ -2480,16 +2600,14 @@ Checks if `value` is an `arguments` object. _.isArguments([1, 2, 3]); // => false ``` - * * * - ### `_.isArray(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L925 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L925 "View in source") [Ⓣ][1] Checks if `value` is an array. @@ -2497,7 +2615,7 @@ Checks if `value` is an array. 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is an array, else `false`. +*(Boolean)*: Returns `true`, if the `value` is an array, else `false`. #### Example ```js @@ -2507,16 +2625,14 @@ Checks if `value` is an array. _.isArray([1, 2, 3]); // => true ``` - * * * - ### `_.isBoolean(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1351 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1351 "View in source") [Ⓣ][1] Checks if `value` is a boolean value. @@ -2524,23 +2640,21 @@ Checks if `value` is a boolean value. 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is a boolean value, else `false`. +*(Boolean)*: Returns `true`, if the `value` is a boolean value, else `false`. #### Example ```js _.isBoolean(null); // => false ``` - * * * - ### `_.isDate(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1368 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1368 "View in source") [Ⓣ][1] Checks if `value` is a date. @@ -2548,23 +2662,21 @@ Checks if `value` is a date. 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is a date, else `false`. +*(Boolean)*: Returns `true`, if the `value` is a date, else `false`. #### Example ```js _.isDate(new Date); // => true ``` - * * * - ### `_.isElement(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1385 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1385 "View in source") [Ⓣ][1] Checks if `value` is a DOM element. @@ -2572,31 +2684,31 @@ Checks if `value` is a DOM element. 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is a DOM element, else `false`. +*(Boolean)*: Returns `true`, if the `value` is a DOM element, else `false`. #### Example ```js _.isElement(document.body); // => true ``` - * * * - ### `_.isEmpty(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1410 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1410 "View in source") [Ⓣ][1] -Checks if `value` is empty. Arrays, strings, or `arguments` objects with a length of `0` and objects with no own enumerable properties are considered "empty". +Checks if `value` is empty. Arrays, strings, or `arguments` objects with a +length of `0` and objects with no own enumerable properties are considered +"empty". #### Arguments 1. `value` *(Array|Object|String)*: The value to inspect. #### Returns -*(Boolean)*: Returns `true`, if the `value` is empty, else `false`. +*(Boolean)*: Returns `true`, if the `value` is empty, else `false`. #### Example ```js @@ -2609,18 +2721,20 @@ _.isEmpty({}); _.isEmpty(''); // => true ``` - * * * - -### `_.isEqual(a, b [, callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1469 "View in source") [Ⓣ][1] +### `_.isEqual(a, b, [callback], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1469 "View in source") [Ⓣ][1] -Performs a deep comparison between two values to determine if they are equivalent to each other. If `callback` is passed, it will be executed to compare values. If `callback` returns `undefined`, comparisons will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with two arguments; *(a, b)*. +Performs a deep comparison between two values to determine if they are +equivalent to each other. If `callback` is passed, it will be executed to +compare values. If `callback` returns `undefined`, comparisons will be handled +by the method instead. The `callback` is bound to `thisArg` and invoked with +two arguments; (a, b). #### Arguments 1. `a` *(Mixed)*: The value to compare. @@ -2629,7 +2743,7 @@ Performs a deep comparison between two values to determine if they are equivalen 4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Boolean)*: Returns `true`, if the values are equvalent, else `false`. +*(Boolean)*: Returns `true`, if the values are equvalent, else `false`. #### Example ```js @@ -2654,26 +2768,26 @@ _.isEqual(words, otherWords, function(a, b) { }); // => true ``` - * * * - ### `_.isFinite(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1650 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1650 "View in source") [Ⓣ][1] Checks if `value` is, or can be coerced to, a finite number. - -Note: This is not the same as native `isFinite`, which will return true for booleans and empty strings. See http://es5.github.com/#x15.1.2.5. +
+
+Note: This is not the same as native `isFinite`, which will return true for +booleans and empty strings. See http://es5.github.com/#x15.1.2.5. #### Arguments 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is finite, else `false`. +*(Boolean)*: Returns `true`, if the `value` is finite, else `false`. #### Example ```js @@ -2692,16 +2806,14 @@ _.isFinite(''); _.isFinite(Infinity); // => false ``` - * * * - ### `_.isFunction(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1667 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1667 "View in source") [Ⓣ][1] Checks if `value` is a function. @@ -2709,33 +2821,33 @@ Checks if `value` is a function. 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is a function, else `false`. +*(Boolean)*: Returns `true`, if the `value` is a function, else `false`. #### Example ```js _.isFunction(_); // => true ``` - * * * - ### `_.isNaN(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1730 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1730 "View in source") [Ⓣ][1] Checks if `value` is `NaN`. - -Note: This is not the same as native `isNaN`, which will return `true` for `undefined` and other values. See http://es5.github.com/#x15.1.2.4. +
+
+Note: This is not the same as native `isNaN`, which will return `true` for +`undefined` and other values. See http://es5.github.com/#x15.1.2.4. #### Arguments 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is `NaN`, else `false`. +*(Boolean)*: Returns `true`, if the `value` is `NaN`, else `false`. #### Example ```js @@ -2751,16 +2863,14 @@ isNaN(undefined); _.isNaN(undefined); // => false ``` - * * * - ### `_.isNull(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1752 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1752 "View in source") [Ⓣ][1] Checks if `value` is `null`. @@ -2768,7 +2878,7 @@ Checks if `value` is `null`. 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is `null`, else `false`. +*(Boolean)*: Returns `true`, if the `value` is `null`, else `false`. #### Example ```js @@ -2778,16 +2888,14 @@ _.isNull(null); _.isNull(undefined); // => false ``` - * * * - ### `_.isNumber(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1769 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1769 "View in source") [Ⓣ][1] Checks if `value` is a number. @@ -2795,31 +2903,30 @@ Checks if `value` is a number. 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is a number, else `false`. +*(Boolean)*: Returns `true`, if the `value` is a number, else `false`. #### Example ```js _.isNumber(8.4 * 5); // => true ``` - * * * - ### `_.isObject(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1697 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1697 "View in source") [Ⓣ][1] -Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)* +Checks if `value` is the language type of Object. +(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) #### Arguments 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is an object, else `false`. +*(Boolean)*: Returns `true`, if the `value` is an object, else `false`. #### Example ```js @@ -2832,16 +2939,14 @@ _.isObject([1, 2, 3]); _.isObject(1); // => false ``` - * * * - ### `_.isPlainObject(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1797 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1797 "View in source") [Ⓣ][1] Checks if a given `value` is an object created by the `Object` constructor. @@ -2849,7 +2954,7 @@ Checks if a given `value` is an object created by the `Object` constructor. 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if `value` is a plain object, else `false`. +*(Boolean)*: Returns `true`, if `value` is a plain object, else `false`. #### Example ```js @@ -2867,16 +2972,14 @@ _.isPlainObject([1, 2, 3]); _.isPlainObject({ 'name': 'moe', 'age': 40 }); // => true ``` - * * * - ### `_.isRegExp(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1822 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1822 "View in source") [Ⓣ][1] Checks if `value` is a regular expression. @@ -2884,23 +2987,21 @@ Checks if `value` is a regular expression. 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is a regular expression, else `false`. +*(Boolean)*: Returns `true`, if the `value` is a regular expression, else `false`. #### Example ```js _.isRegExp(/moe/); // => true ``` - * * * - ### `_.isString(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1839 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1839 "View in source") [Ⓣ][1] Checks if `value` is a string. @@ -2908,23 +3009,21 @@ Checks if `value` is a string. 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is a string, else `false`. +*(Boolean)*: Returns `true`, if the `value` is a string, else `false`. #### Example ```js _.isString('moe'); // => true ``` - * * * - ### `_.isUndefined(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1856 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1856 "View in source") [Ⓣ][1] Checks if `value` is `undefined`. @@ -2932,23 +3031,21 @@ Checks if `value` is `undefined`. 1. `value` *(Mixed)*: The value to check. #### Returns -*(Boolean)*: Returns `true`, if the `value` is `undefined`, else `false`. +*(Boolean)*: Returns `true`, if the `value` is `undefined`, else `false`. #### Example ```js _.isUndefined(void 0); // => true ``` - * * * - ### `_.keys(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L944 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L944 "View in source") [Ⓣ][1] Creates an array composed of the own enumerable property names of `object`. @@ -2956,25 +3053,29 @@ Creates an array composed of the own enumerable property names of `object`. 1. `object` *(Object)*: The object to inspect. #### Returns -*(Array)*: Returns a new array of property names. +*(Array)*: Returns a new array of property names. #### Example ```js _.keys({ 'one': 1, 'two': 2, 'three': 3 }); // => ['one', 'two', 'three'] (order is not guaranteed) ``` - * * * - -### `_.merge(object [, source1, source2, ..., callback, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L1916 "View in source") [Ⓣ][1] +### `_.merge(object, [source1, source2, ...], [callback], [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L1916 "View in source") [Ⓣ][1] -Recursively merges own enumerable properties of the source object(s), that don't resolve to `undefined`, into the destination object. Subsequent sources will overwrite propery assignments of previous sources. If a `callback` function is passed, it will be executed to produce the merged values of the destination and source properties. If `callback` returns `undefined`, merging will be handled by the method instead. The `callback` is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*. +Recursively merges own enumerable properties of the source object(s), that +don't resolve to `undefined`, into the destination object. Subsequent sources +will overwrite propery assignments of previous sources. If a `callback` function +is passed, it will be executed to produce the merged values of the destination +and source properties. If `callback` returns `undefined`, merging will be +handled by the method instead. The `callback` is bound to `thisArg` and +invoked with two arguments; (objectValue, sourceValue). #### Arguments 1. `object` *(Object)*: The destination object. @@ -2983,7 +3084,7 @@ Recursively merges own enumerable properties of the source object(s), that don't 4. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Object)*: Returns the destination object. +*(Object)*: Returns the destination object. #### Example ```js @@ -3019,26 +3120,28 @@ _.merge(food, otherFood, function(a, b) { }); // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] } ``` - * * * - -### `_.omit(object, callback|[prop1, prop2, ..., thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2023 "View in source") [Ⓣ][1] +### `_.omit(object, [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2023 "View in source") [Ⓣ][1] -Creates a shallow clone of `object` excluding the specified properties. Property names may be specified as individual arguments or as arrays of property names. If a `callback` function is passed, it will be executed for each property in the `object`, omitting the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. +Creates a shallow clone of `object` excluding the specified properties. +Property names may be specified as individual arguments or as arrays of +property names. If a `callback` function is passed, it will be executed +for each property in the `object`, omitting the properties `callback` +returns truthy for. The `callback` is bound to `thisArg` and invoked +with three arguments; (value, key, object). #### Arguments 1. `object` *(Object)*: The source object. -2. `callback|[prop1, prop2, ...]` *(Function|String)*: The properties to omit or the function called per iteration. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. +2. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Object)*: Returns an object without the omitted properties. +*(Object)*: Returns an object without the omitted properties. #### Example ```js @@ -3050,50 +3153,50 @@ _.omit({ 'name': 'moe', 'age': 40 }, function(value) { }); // => { 'name': 'moe' } ``` - * * * - ### `_.pairs(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2057 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2057 "View in source") [Ⓣ][1] -Creates a two dimensional array of the given object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`. +Creates a two dimensional array of the given object's key-value pairs, +i.e. `[[key1, value1], [key2, value2]]`. #### Arguments 1. `object` *(Object)*: The object to inspect. #### Returns -*(Array)*: Returns new array of key-value pairs. +*(Array)*: Returns new array of key-value pairs. #### Example ```js _.pairs({ 'moe': 30, 'larry': 40 }); // => [['moe', 30], ['larry', 40]] (order is not guaranteed) ``` - * * * - -### `_.pick(object, callback|[prop1, prop2, ..., thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2095 "View in source") [Ⓣ][1] +### `_.pick(object, [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2095 "View in source") [Ⓣ][1] -Creates a shallow clone of `object` composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names. If `callback` is passed, it will be executed for each property in the `object`, picking the properties `callback` returns truthy for. The `callback` is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. +Creates a shallow clone of `object` composed of the specified properties. +Property names may be specified as individual arguments or as arrays of property +names. If `callback` is passed, it will be executed for each property in the +`object`, picking the properties `callback` returns truthy for. The `callback` +is bound to `thisArg` and invoked with three arguments; (value, key, object). #### Arguments 1. `object` *(Object)*: The source object. -2. `callback|[prop1, prop2, ...]` *(Array|Function|String)*: The function called per iteration or properties to pick, either as individual arguments or arrays. -3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. +2. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Object)*: Returns an object composed of the picked properties. +*(Object)*: Returns an object composed of the picked properties. #### Example ```js @@ -3105,16 +3208,14 @@ _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) { }); // => { 'name': 'moe' } ``` - * * * - ### `_.values(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L2132 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L2132 "View in source") [Ⓣ][1] Creates an array composed of the own enumerable property values of `object`. @@ -3122,22 +3223,19 @@ Creates an array composed of the own enumerable property values of `object`. 1. `object` *(Object)*: The object to inspect. #### Returns -*(Array)*: Returns a new array of property values. +*(Array)*: Returns a new array of property values. #### Example ```js _.values({ 'one': 1, 'two': 2, 'three': 3 }); // => [1, 2, 3] ``` - * * * - - ## `“Utilities” Methods` @@ -3145,31 +3243,30 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 }); ### `_.escape(string)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4457 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4457 "View in source") [Ⓣ][1] -Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities. +Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their +corresponding HTML entities. #### Arguments 1. `string` *(String)*: The string to escape. #### Returns -*(String)*: Returns the escaped string. +*(String)*: Returns the escaped string. #### Example ```js _.escape('Moe, Larry & Curly'); // => 'Moe, Larry & Curly' ``` - * * * - ### `_.identity(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4475 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4475 "View in source") [Ⓣ][1] This function returns the first argument passed to it. @@ -3177,7 +3274,7 @@ This function returns the first argument passed to it. 1. `value` *(Mixed)*: Any value. #### Returns -*(Mixed)*: Returns `value`. +*(Mixed)*: Returns `value`. #### Example ```js @@ -3185,18 +3282,17 @@ var moe = { 'name': 'moe' }; moe === _.identity(moe); // => true ``` - * * * - ### `_.mixin(object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4501 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4501 "View in source") [Ⓣ][1] -Adds functions properties of `object` to the `lodash` function and chainable wrapper. +Adds functions properties of `object` to the `lodash` function and chainable +wrapper. #### Arguments 1. `object` *(Object)*: The object of function properties to add to `lodash`. @@ -3215,45 +3311,43 @@ _.capitalize('moe'); _('moe').capitalize(); // => 'Moe' ``` - * * * - ### `_.noConflict()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4525 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4525 "View in source") [Ⓣ][1] -Reverts the '_' variable to its previous value and returns a reference to the `lodash` function. +Reverts the '_' variable to its previous value and returns a reference to +the `lodash` function. #### Returns -*(Function)*: Returns the `lodash` function. +*(Function)*: Returns the `lodash` function. #### Example ```js var lodash = _.noConflict(); ``` - * * * - -### `_.random([min=0, max=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4548 "View in source") [Ⓣ][1] +### `_.random([min=0], [max=1])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4548 "View in source") [Ⓣ][1] -Produces a random number between `min` and `max` *(inclusive)*. If only one argument is passed, a number between `0` and the given number will be returned. +Produces a random number between `min` and `max` (inclusive). If only one +argument is passed, a number between `0` and the given number will be returned. #### Arguments 1. `[min=0]` *(Number)*: The minimum possible value. 2. `[max=1]` *(Number)*: The maximum possible value. #### Returns -*(Number)*: Returns a random number. +*(Number)*: Returns a random number. #### Example ```js @@ -3263,25 +3357,25 @@ _.random(0, 5); _.random(5); // => also a number between 0 and 5 ``` - * * * - ### `_.result(object, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4586 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4586 "View in source") [Ⓣ][1] -Resolves the value of `property` on `object`. If `property` is a function, it will be invoked and its result returned, else the property value is returned. If `object` is falsey, then `null` is returned. +Resolves the value of `property` on `object`. If `property` is a function, +it will be invoked and its result returned, else the property value is +returned. If `object` is falsey, then `null` is returned. #### Arguments 1. `object` *(Object)*: The object to inspect. 2. `property` *(String)*: The property to get the value of. #### Returns -*(Mixed)*: Returns the resolved value. +*(Mixed)*: Returns the resolved value. #### Example ```js @@ -3298,26 +3392,31 @@ _.result(object, 'cheese'); _.result(object, 'stuff'); // => 'nonsense' ``` - * * * - ### `_.template(text, data, options)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4674 "View in source") [Ⓣ][1] - -A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code. - -Note: In the development build, `_.template` utilizes sourceURLs for easier debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl - -Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp` build and using precompiled templates, or loading Lo-Dash in a sandbox. - +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4674 "View in source") [Ⓣ][1] + +A micro-templating method that handles arbitrary delimiters, preserves +whitespace, and correctly escapes quotes within interpolated code. +
+
+Note: In the development build, `_.template` utilizes sourceURLs for easier +debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl +
+
+Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp` +build and using precompiled templates, or loading Lo-Dash in a sandbox. +
+
For more information on precompiling templates see:
-http://lodash.com/#custom-builds - +https://lodash.com/#custom-builds +
+
For more information on Chrome extension sandboxes see:
http://developer.chrome.com/stable/extensions/sandboxingEval.html @@ -3327,7 +3426,8 @@ http://developer.chrome.com/stable/extensions/sandboxingEval.html 3. `options` *(Object)*: The options object. escape - The "escape" delimiter regexp. evaluate - The "evaluate" delimiter regexp. interpolate - The "interpolate" delimiter regexp. sourceURL - The sourceURL of the template's compiled source. variable - The data object variable name. #### Returns -*(Function, String)*: Returns a compiled function when no `data` object is given, else it returns the interpolated text. +*(Function|String)*: Returns a compiled function when no `data` object +is given, else it returns the interpolated text. #### Example ```js @@ -3382,18 +3482,18 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\ };\ '); ``` - * * * - -### `_.times(n, callback [, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4800 "View in source") [Ⓣ][1] +### `_.times(n, callback, [thisArg])` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4800 "View in source") [Ⓣ][1] -Executes the `callback` function `n` times, returning an array of the results of each `callback` execution. The `callback` is bound to `thisArg` and invoked with one argument; *(index)*. +Executes the `callback` function `n` times, returning an array of the results +of each `callback` execution. The `callback` is bound to `thisArg` and invoked +with one argument; (index). #### Arguments 1. `n` *(Number)*: The number of times to execute the callback. @@ -3401,7 +3501,7 @@ Executes the `callback` function `n` times, returning an array of the results of 3. `[thisArg]` *(Mixed)*: The `this` binding of `callback`. #### Returns -*(Array)*: Returns a new array of the results of each `callback` execution. +*(Array)*: Returns a new array of the results of each `callback` execution. #### Example ```js @@ -3414,40 +3514,38 @@ _.times(3, function(n) { mage.castSpell(n); }); _.times(3, function(n) { this.cast(n); }, mage); // => also calls `mage.castSpell(n)` three times ``` - * * * - ### `_.unescape(string)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4826 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4826 "View in source") [Ⓣ][1] -The opposite of `_.escape`, this method converts the HTML entities `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding characters. +The opposite of `_.escape`, this method converts the HTML entities +`&`, `<`, `>`, `"`, and `'` in `string` to their +corresponding characters. #### Arguments 1. `string` *(String)*: The string to unescape. #### Returns -*(String)*: Returns the unescaped string. +*(String)*: Returns the unescaped string. #### Example ```js _.unescape('Moe, Larry & Curly'); // => 'Moe, Larry & Curly' ``` - * * * - ### `_.uniqueId([prefix])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4846 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L4846 "View in source") [Ⓣ][1] Generates a unique ID. If `prefix` is passed, the ID will be appended to it. @@ -3455,7 +3553,7 @@ Generates a unique ID. If `prefix` is passed, the ID will be appended to it. 1. `[prefix]` *(String)*: The value to prefix the ID with. #### Returns -*(String)*: Returns the unique ID. +*(String)*: Returns the unique ID. #### Example ```js @@ -3465,15 +3563,12 @@ _.uniqueId('contact_'); _.uniqueId(); // => '105' ``` - * * * - - ## `Methods` @@ -3481,7 +3576,7 @@ _.uniqueId(); ### `_.templateSettings.imports._` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L341 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L341 "View in source") [Ⓣ][1] A reference to the `lodash` function. @@ -3489,10 +3584,8 @@ A reference to the `lodash` function. - - ## `Properties` @@ -3500,91 +3593,84 @@ A reference to the `lodash` function. ### `_.VERSION` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5076 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L5076 "View in source") [Ⓣ][1] -*(String)*: The semantic version number. +(String): The semantic version number. * * * - ### `_.templateSettings` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L293 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L293 "View in source") [Ⓣ][1] -*(Object)*: By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby *(ERB)*. Change the following template settings to use alternative delimiters. +(Object): By default, the template delimiters used by Lo-Dash are similar to those in +embedded Ruby (ERB). Change the following template settings to use alternative +delimiters. * * * - ### `_.templateSettings.escape` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L301 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L301 "View in source") [Ⓣ][1] -*(RegExp)*: Used to detect `data` property values to be HTML-escaped. +(RegExp): Used to detect `data` property values to be HTML-escaped. * * * - ### `_.templateSettings.evaluate` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L309 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L309 "View in source") [Ⓣ][1] -*(RegExp)*: Used to detect code to be evaluated. +(RegExp): Used to detect code to be evaluated. * * * - -### `_.templateSettings.interpolate` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L317 "View in source") [Ⓣ][1] +### `_.templateSettings.imports` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L333 "View in source") [Ⓣ][1] -*(RegExp)*: Used to detect `data` property values to inject. +(Object): Used to import variables into the compiled template. * * * - -### `_.templateSettings.variable` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L325 "View in source") [Ⓣ][1] +### `_.templateSettings.interpolate` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L317 "View in source") [Ⓣ][1] -*(String)*: Used to reference the data object in the template text. +(RegExp): Used to detect `data` property values to inject. * * * - -### `_.templateSettings.imports` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L333 "View in source") [Ⓣ][1] +### `_.templateSettings.variable` +# [Ⓢ](https://github.com/lodash/lodash/blob/1.0.2/lodash.js#L325 "View in source") [Ⓣ][1] -*(Object)*: Used to import variables into the compiled template. +(String): Used to reference the data object in the template text. * * * - - - - [1]: #Arrays "Jump back to the TOC." \ No newline at end of file + [1]: #arrays "Jump back to the TOC." diff --git a/doc/parse.php b/doc/parse.php index 978138945e..3fa7a9d086 100644 --- a/doc/parse.php +++ b/doc/parse.php @@ -1,36 +1,38 @@ version; + // generate Markdown $markdown = docdown(array( - 'path' => '../' . $file, - 'title' => 'Lo-Dash v1.0.1', + 'path' => '../' . $filePath, + 'title' => 'Lo-Dash v' . $version . '', 'toc' => 'categories', - 'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js' + 'url' => 'https://github.com/lodash/lodash/blob/' . $version . '/lodash.js' )); - // save to a .md file - file_put_contents($output . '.md', $markdown); + // save to a `.md` file + file_put_contents($outputName . '.md', $markdown); // print header('Content-Type: text/plain;charset=utf-8'); echo $markdown . PHP_EOL; - -?> \ No newline at end of file +?> diff --git a/lodash.js b/lodash.js index 6babfef378..eee88a7d5c 100644 --- a/lodash.js +++ b/lodash.js @@ -1,10 +1,10 @@ /** * @license - * Lo-Dash 1.0.1 + * Lo-Dash 1.0.2 * Copyright 2012-2013 The Dojo Foundation * Based on Underscore.js 1.4.4 * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. - * Available under MIT license + * Available under MIT license */ ;(function(window, undefined) { @@ -4599,7 +4599,7 @@ * build and using precompiled templates, or loading Lo-Dash in a sandbox. * * For more information on precompiling templates see: - * http://lodash.com/#custom-builds + * https://lodash.com/#custom-builds * * For more information on Chrome extension sandboxes see: * http://developer.chrome.com/stable/extensions/sandboxingEval.html @@ -5073,7 +5073,7 @@ * @memberOf _ * @type String */ - lodash.VERSION = '1.0.1'; + lodash.VERSION = '1.0.2'; // add "Chaining" functions to the wrapper lodash.prototype.toString = wrapperToString; diff --git a/package.json b/package.json index a55a0c0713..7ba4ff0b02 100644 --- a/package.json +++ b/package.json @@ -1,52 +1,20 @@ { "name": "lodash", - "version": "1.0.1", - "description": "An alternative to Underscore.js, delivering consistency, customization, performance, and extra features.", - "homepage": "http://lodash.com", - "main": "./dist/lodash", - "keywords": [ - "browser", - "client", - "functional", - "performance", - "server", - "speed", - "util" - ], - "licenses": [ - { - "type": "MIT", - "url": "http://lodash.com/license" - } - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "web": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/bestiejs/lodash/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/bestiejs/lodash.git" - }, - "bin": { - "lodash": "./build.js" - }, - "directories": { - "doc": "./doc", - "test": "./test" - }, - "engines": [ - "node", - "rhino" + "version": "1.0.2", + "description": "A utility library delivering consistency, customization, performance, and extras.", + "homepage": "https://lodash.com/", + "license": "MIT", + "main": "./dist/lodash.js", + "keywords": ["browser", "client", "functional", "performance", "server", "speed", "util"], + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Blaine Bublitz (http://www.iceddev.com/)", + "Kit Cambridge (http://kitcambridge.be/)", + "Mathias Bynens (https://mathiasbynens.be/)" ], + "repository": "lodash/lodash", "jam": { - "main": "./lodash.js" - }, - "scripts": { - "build": "node ./build.js", - "test": "node ./test/test.js ./dist/lodash.js && node ./test/test.js ./dist/lodash.min.js && node ./test/test-build.js" + "main": "./dist/lodash.compat.js" } }