Add comments, documentation, and update the minified build.

Former-commit-id: c65665063f254b1ba9dab9c6948fedf29f1e795f
This commit is contained in:
John-David Dalton
2012-06-11 22:49:24 -04:00
parent 3a698eb0ed
commit a5873a3158
3 changed files with 56 additions and 48 deletions

View File

@@ -147,7 +147,7 @@ The `lodash` function.
<!-- div -->
### <a id="_version"></a>`_.VERSION`
<a href="#_version">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3344 "View in source") [&#x24C9;][1]
<a href="#_version">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3352 "View in source") [&#x24C9;][1]
*(String)*: The semantic version number.
@@ -270,7 +270,7 @@ jQuery('#lodash_button').on('click', buttonView.onClick);
<!-- div -->
### <a id="_chainvalue"></a>`_.chain(value)`
<a href="#_chainvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3296 "View in source") [&#x24C9;][1]
<a href="#_chainvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3304 "View in source") [&#x24C9;][1]
Wraps the value in a `lodash` chainable object.
@@ -533,7 +533,7 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]);
<!-- div -->
### <a id="_escapestring"></a>`_.escape(string)`
<a href="#_escapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2987 "View in source") [&#x24C9;][1]
<a href="#_escapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2992 "View in source") [&#x24C9;][1]
Escapes a string for inclusion in HTML, replacing `&`, `<`, `"`, and `'` characters.
@@ -888,7 +888,7 @@ _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
<!-- div -->
### <a id="_identityvalue"></a>`_.identity(value)`
<a href="#_identityvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3006 "View in source") [&#x24C9;][1]
<a href="#_identityvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3011 "View in source") [&#x24C9;][1]
This function returns the first argument passed to it. Note: It is used throughout Lo-Dash as a default callback.
@@ -1209,7 +1209,7 @@ _.isEqual(moe, clone);
<!-- div -->
### <a id="_isfinitevalue"></a>`_.isFinite(value)`
<a href="#_isfinitevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2684 "View in source") [&#x24C9;][1]
<a href="#_isfinitevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2689 "View in source") [&#x24C9;][1]
Checks if a `value` is a finite number.
@@ -1239,7 +1239,7 @@ _.isFinite(Infinity);
<!-- div -->
### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
<a href="#_isfunctionvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2701 "View in source") [&#x24C9;][1]
<a href="#_isfunctionvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2706 "View in source") [&#x24C9;][1]
Checks if a `value` is a function.
@@ -1263,7 +1263,7 @@ _.isFunction(''.concat);
<!-- div -->
### <a id="_isnanvalue"></a>`_.isNaN(value)`
<a href="#_isnanvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2752 "View in source") [&#x24C9;][1]
<a href="#_isnanvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2757 "View in source") [&#x24C9;][1]
Checks if a `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.
@@ -1296,7 +1296,7 @@ _.isNaN(undefined);
<!-- div -->
### <a id="_isnullvalue"></a>`_.isNull(value)`
<a href="#_isnullvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2774 "View in source") [&#x24C9;][1]
<a href="#_isnullvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2779 "View in source") [&#x24C9;][1]
Checks if a `value` is `null`.
@@ -1323,7 +1323,7 @@ _.isNull(undefined);
<!-- div -->
### <a id="_isnumbervalue"></a>`_.isNumber(value)`
<a href="#_isnumbervalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2791 "View in source") [&#x24C9;][1]
<a href="#_isnumbervalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2796 "View in source") [&#x24C9;][1]
Checks if a `value` is a number.
@@ -1347,7 +1347,7 @@ _.isNumber(8.4 * 5;
<!-- div -->
### <a id="_isobjectvalue"></a>`_.isObject(value)`
<a href="#_isobjectvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2722 "View in source") [&#x24C9;][1]
<a href="#_isobjectvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2727 "View in source") [&#x24C9;][1]
Checks if a `value` is the language type of Object. *(e.g. arrays, functions, objects, regexps, `new Number(0)*`, and `new String('')`)
@@ -1374,7 +1374,7 @@ _.isObject(1);
<!-- div -->
### <a id="_isregexpvalue"></a>`_.isRegExp(value)`
<a href="#_isregexpvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2808 "View in source") [&#x24C9;][1]
<a href="#_isregexpvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2813 "View in source") [&#x24C9;][1]
Checks if a `value` is a regular expression.
@@ -1398,7 +1398,7 @@ _.isRegExp(/moe/);
<!-- div -->
### <a id="_isstringvalue"></a>`_.isString(value)`
<a href="#_isstringvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2825 "View in source") [&#x24C9;][1]
<a href="#_isstringvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2830 "View in source") [&#x24C9;][1]
Checks if a `value` is a string.
@@ -1422,7 +1422,7 @@ _.isString('moe');
<!-- div -->
### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
<a href="#_isundefinedvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2842 "View in source") [&#x24C9;][1]
<a href="#_isundefinedvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2847 "View in source") [&#x24C9;][1]
Checks if a `value` is `undefined`.
@@ -1446,7 +1446,7 @@ _.isUndefined(void 0);
<!-- div -->
### <a id="_keysobject"></a>`_.keys(object)`
<a href="#_keysobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2859 "View in source") [&#x24C9;][1]
<a href="#_keysobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2864 "View in source") [&#x24C9;][1]
Produces an array of object`'s own enumerable property names.
@@ -1638,7 +1638,7 @@ _.min([10, 5, 100, 2, 1000]);
<!-- div -->
### <a id="_mixinobject"></a>`_.mixin(object)`
<a href="#_mixinobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3032 "View in source") [&#x24C9;][1]
<a href="#_mixinobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3037 "View in source") [&#x24C9;][1]
Adds functions properties of `object` to the `lodash` function and chainable wrapper.
@@ -1668,7 +1668,7 @@ _('larry').capitalize();
<!-- div -->
### <a id="_noconflict"></a>`_.noConflict()`
<a href="#_noconflict">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3063 "View in source") [&#x24C9;][1]
<a href="#_noconflict">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3068 "View in source") [&#x24C9;][1]
Reverts the '_' variable to its previous value and returns a reference to the `lodash` function.
@@ -1741,7 +1741,7 @@ hi('moe');
<!-- div -->
### <a id="_pickobject--prop1-prop2-"></a>`_.pick(object [, prop1, prop2, ...])`
<a href="#_pickobject--prop1-prop2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2881 "View in source") [&#x24C9;][1]
<a href="#_pickobject--prop1-prop2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2886 "View in source") [&#x24C9;][1]
Creates an object composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names.
@@ -1942,9 +1942,9 @@ _.rest([3, 2, 1]);
<!-- div -->
### <a id="_resultobject-property"></a>`_.result(object, property)`
<a href="#_resultobject-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3093 "View in source") [&#x24C9;][1]
<a href="#_resultobject-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3099 "View in source") [&#x24C9;][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.
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.
@@ -2001,7 +2001,7 @@ _.shuffle([1, 2, 3, 4, 5, 6]);
<!-- div -->
### <a id="_sizevalue"></a>`_.size(value)`
<a href="#_sizevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2919 "View in source") [&#x24C9;][1]
<a href="#_sizevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2924 "View in source") [&#x24C9;][1]
Gets the size of `value` by returning `value.length` if `value` is a string or array, or the number of own enumerable properties if `value` is an object.
@@ -2130,7 +2130,7 @@ _.sortedIndex(['twenty', 'thirty', 'fourty'], 'thirty-five', function(word) {
<!-- div -->
### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
<a href="#_tapvalue-interceptor">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2947 "View in source") [&#x24C9;][1]
<a href="#_tapvalue-interceptor">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2952 "View in source") [&#x24C9;][1]
Invokes `interceptor` with the `value` as the first argument, and then returns `value`. The primary purpose of this method is to "tap into" a method chain, in order to performoperations on intermediate results within the chain.
@@ -2160,7 +2160,7 @@ _.chain([1,2,3,200])
<!-- div -->
### <a id="_templatetext-data-options"></a>`_.template(text, data, options)`
<a href="#_templatetext-data-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3152 "View in source") [&#x24C9;][1]
<a href="#_templatetext-data-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3160 "View in source") [&#x24C9;][1]
A micro-templating method, similar to John Resig's implementation. Lo-Dash templating handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code.
@@ -2244,7 +2244,7 @@ jQuery(window).on('scroll', throttled);
<!-- div -->
### <a id="_timesn-callback--thisarg"></a>`_.times(n, callback [, thisArg])`
<a href="#_timesn-callback--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3239 "View in source") [&#x24C9;][1]
<a href="#_timesn-callback--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3247 "View in source") [&#x24C9;][1]
Executes the `callback` function `n` times. The `callback` is bound to `thisArg` and invoked with `1` argument; *(index)*.
@@ -2354,7 +2354,7 @@ _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math);
<!-- div -->
### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix])`
<a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3266 "View in source") [&#x24C9;][1]
<a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3274 "View in source") [&#x24C9;][1]
Generates a unique id. If `prefix` is passed, the id will be appended to it.
@@ -2378,7 +2378,7 @@ _.uniqueId('contact_');
<!-- div -->
### <a id="_valuesobject"></a>`_.values(object)`
<a href="#_valuesobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2965 "View in source") [&#x24C9;][1]
<a href="#_valuesobject">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L2970 "View in source") [&#x24C9;][1]
Produces an array of `object`'s own enumerable property values.
@@ -2488,7 +2488,7 @@ _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
<!-- div -->
### <a id="_prototypechain"></a>`_.prototype.chain()`
<a href="#_prototypechain">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3314 "View in source") [&#x24C9;][1]
<a href="#_prototypechain">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3322 "View in source") [&#x24C9;][1]
Extracts the value from a wrapped chainable object.
@@ -2509,7 +2509,7 @@ _([1, 2, 3]).value();
<!-- div -->
### <a id="_prototypevalue"></a>`_.prototype.value()`
<a href="#_prototypevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3331 "View in source") [&#x24C9;][1]
<a href="#_prototypevalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/v0.3.1/lodash.js#L3339 "View in source") [&#x24C9;][1]
Extracts the value from a wrapped chainable object.