From 0669a053dbc0969f3c5ad317e286846bda86e152 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 14 Aug 2013 23:30:29 -0700 Subject: [PATCH] Clarify a bit more the `order is not guaranteed` notes on object iteration. Former-commit-id: bfe3033325bc941a03948fe41056634663a10989 --- dist/lodash.compat.js | 20 +++++------ dist/lodash.compat.min.js | 2 +- dist/lodash.js | 20 +++++------ dist/lodash.min.js | 2 +- dist/lodash.underscore.js | 18 +++++----- dist/lodash.underscore.min.js | 4 +-- doc/README.md | 66 +++++++++++++++++------------------ lodash.js | 16 ++++----- 8 files changed, 71 insertions(+), 77 deletions(-) diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index e13fae63b..4e6a6744a 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -1706,7 +1706,7 @@ * @example * * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); - * // => ['one', 'two', 'three'] (order is not guaranteed) + * // => ['one', 'two', 'three'] (property order is not guaranteed across environments) */ var keys = !nativeKeys ? shimKeys : function(object) { if (!isObject(object)) { @@ -1969,7 +1969,7 @@ * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { * return num % 2 == 0; * }); - * // => 'b' (order is not guaranteed) + * // => 'b' (property order is not guaranteed across environments) */ function findKey(object, callback, thisArg) { var result; @@ -2042,7 +2042,7 @@ * _.forIn(new Dog('Dagny'), function(value, key) { * console.log(key); * }); - * // => logs 'bark' and 'name' (order is not guaranteed) + * // => logs 'bark' and 'name' (property order is not guaranteed across environments) */ var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, { 'useHas': false @@ -2110,7 +2110,7 @@ * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { * console.log(key); * }); - * // => logs '0', '1', and 'length' (order is not guaranteed) + * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) */ var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions); @@ -2729,7 +2729,7 @@ * @example * * _.pairs({ 'moe': 30, 'larry': 40 }); - * // => [['moe', 30], ['larry', 40]] (order is not guaranteed) + * // => [['moe', 30], ['larry', 40]] (property order is not guaranteed across environments) */ function pairs(object) { var index = -1, @@ -2857,7 +2857,7 @@ * @example * * _.values({ 'one': 1, 'two': 2, 'three': 3 }); - * // => [1, 2, 3] (order is not guaranteed) + * // => [1, 2, 3] (property order is not guaranteed across environments) */ function values(object) { var index = -1, @@ -3242,7 +3242,7 @@ * // => logs each number and returns '1,2,3' * * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); }); - * // => logs each number value and returns the object (order is not guaranteed) + * // => logs each number and returns the object (property order is not guaranteed across environments) */ function forEach(collection, callback, thisArg) { if (callback && typeof thisArg == 'undefined' && isArray(collection)) { @@ -3440,7 +3440,7 @@ * // => [3, 6, 9] * * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); - * // => [3, 6, 9] (order is not guaranteed) + * // => [3, 6, 9] (property order is not guaranteed across environments) * * var stooges = [ * { 'name': 'moe', 'age': 40 }, @@ -5320,9 +5320,7 @@ var isCalled = trailing && (!leading || callCount > 1); clear(); if (isCalled) { - if (maxWait !== false) { - lastCalled = +new Date; - } + lastCalled = +new Date; result = func.apply(thisArg, args); } }; diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index de2613f37..2211b955a 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -22,7 +22,7 @@ r+="}"}return(n.b||$e.nonEnumArgs)&&(r+="}"),r+=n.c+";return E",t=t("d,j,k,m,o,p }}else t=!t&&_t(n)?u:_.createCallback(t,e,3),Ue(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,o=n)});return o}function It(n,t,e,r){var u=3>arguments.length;if(t=Y(t,r,4),ze(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++oarguments.length;return t=Y(t,r,4),Ot(n,function(n,r,o){e=u?(u=b,n):t(e,n,r,o)}),e}function Pt(n,t,e){var r;if(t=_.createCallback(t,e,3),ze(n)){e=-1;for(var u=n.length;++e=E&&u===t;if(c){var l=a(i);l?(u=e,i=l):c=b}for(;++ru(i,l)&&f.push(l);return c&&g(i),f}function Rt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=d){var o=-1;for(t=_.createCallback(t,e,3);++or?Se(0,u+r):r||0}else if(r)return r=$t(n,e),n[r]===e?r:-1; return n?t(n,e,r):-1}function Dt(n,t,e){if(typeof t!="number"&&t!=d){var r=0,u=-1,o=n?n.length:0;for(t=_.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++tc&&(i=n.apply(f,a));else{var e=+new Vt;!s&&!v&&(l=e);var o=p-(e-l);0 ['one', 'two', 'three'] (order is not guaranteed) + * // => ['one', 'two', 'three'] (property order is not guaranteed across environments) */ var keys = !nativeKeys ? shimKeys : function(object) { if (!isObject(object)) { @@ -1645,7 +1645,7 @@ * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { * return num % 2 == 0; * }); - * // => 'b' (order is not guaranteed) + * // => 'b' (property order is not guaranteed across environments) */ function findKey(object, callback, thisArg) { var result; @@ -1718,7 +1718,7 @@ * _.forIn(new Dog('Dagny'), function(value, key) { * console.log(key); * }); - * // => logs 'bark' and 'name' (order is not guaranteed) + * // => logs 'bark' and 'name' (property order is not guaranteed across environments) */ var forIn = function(collection, callback, thisArg) { var index, iterable = collection, result = iterable; @@ -1793,7 +1793,7 @@ * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { * console.log(key); * }); - * // => logs '0', '1', and 'length' (order is not guaranteed) + * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) */ var forOwn = function(collection, callback, thisArg) { var index, iterable = collection, result = iterable; @@ -2419,7 +2419,7 @@ * @example * * _.pairs({ 'moe': 30, 'larry': 40 }); - * // => [['moe', 30], ['larry', 40]] (order is not guaranteed) + * // => [['moe', 30], ['larry', 40]] (property order is not guaranteed across environments) */ function pairs(object) { var index = -1, @@ -2547,7 +2547,7 @@ * @example * * _.values({ 'one': 1, 'two': 2, 'three': 3 }); - * // => [1, 2, 3] (order is not guaranteed) + * // => [1, 2, 3] (property order is not guaranteed across environments) */ function values(object) { var index = -1, @@ -2929,7 +2929,7 @@ * // => logs each number and returns '1,2,3' * * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); }); - * // => logs each number value and returns the object (order is not guaranteed) + * // => logs each number and returns the object (property order is not guaranteed across environments) */ function forEach(collection, callback, thisArg) { var index = -1, @@ -3126,7 +3126,7 @@ * // => [3, 6, 9] * * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); - * // => [3, 6, 9] (order is not guaranteed) + * // => [3, 6, 9] (property order is not guaranteed across environments) * * var stooges = [ * { 'name': 'moe', 'age': 40 }, @@ -5017,9 +5017,7 @@ var isCalled = trailing && (!leading || callCount > 1); clear(); if (isCalled) { - if (maxWait !== false) { - lastCalled = now(); - } + lastCalled = now(); result = func.apply(thisArg, args); } }; diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 98bfc43d8..1bfd62fb0 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -22,7 +22,7 @@ return n}function Et(n,t,r){var e=n?n.length:0;if(typeof e!="number")var u=qr(n) });return o}function At(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Ht(e);++rarguments.length;t=rt(t,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(r=n[++o]);++oarguments.length;return t=rt(t,e,4),Et(n,function(n,e,o){r=u?(u=_,n):t(r,n,e,o)}),r}function Bt(n,t,r){var e;t=Z.createCallback(t,r,3),r=-1; var u=n?n.length:0;if(typeof u=="number")for(;++r=k&&u===t;if(c){var l=i(a);l?(u=r,a=l):c=_}for(;++eu(a,l)&&f.push(l);return c&&s(a),f}function Dt(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=m){var o=-1;for(t=Z.createCallback(t,r,3);++oe?Ir(0,u+e):e||0}else if(e)return e=zt(n,r),n[e]===r?e:-1;return n?t(n,r,e):-1}function Tt(n,t,r){if(typeof t!="number"&&t!=m){var e=0,u=-1,o=n?n.length:0;for(t=Z.createCallback(t,r,3);++u>>1,r(n[e])r?0:r);++tr?0:r);++tc&&(a=n.apply(f,i));else{var r=gr();!s&&!g&&(l=r);var o=p-(r-l);0/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:Z}}; diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 02fc342c5..9b12e3eaa 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -810,7 +810,7 @@ * @example * * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); - * // => ['one', 'two', 'three'] (order is not guaranteed) + * // => ['one', 'two', 'three'] (property order is not guaranteed across environments) */ var keys = !nativeKeys ? shimKeys : function(object) { if (!isObject(object)) { @@ -1000,7 +1000,7 @@ * _.forIn(new Dog('Dagny'), function(value, key) { * console.log(key); * }); - * // => logs 'bark' and 'name' (order is not guaranteed) + * // => logs 'bark' and 'name' (property order is not guaranteed across environments) */ var forIn = function(collection, callback) { var index, iterable = collection, result = iterable; @@ -1031,7 +1031,7 @@ * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { * console.log(key); * }); - * // => logs '0', '1', and 'length' (order is not guaranteed) + * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) */ var forOwn = function(collection, callback) { var index, iterable = collection, result = iterable; @@ -1499,7 +1499,7 @@ * @example * * _.pairs({ 'moe': 30, 'larry': 40 }); - * // => [['moe', 30], ['larry', 40]] (order is not guaranteed) + * // => [['moe', 30], ['larry', 40]] (property order is not guaranteed across environments) */ function pairs(object) { var index = -1, @@ -1567,7 +1567,7 @@ * @example * * _.values({ 'one': 1, 'two': 2, 'three': 3 }); - * // => [1, 2, 3] (order is not guaranteed) + * // => [1, 2, 3] (property order is not guaranteed across environments) */ function values(object) { var index = -1, @@ -1903,7 +1903,7 @@ * // => logs each number and returns '1,2,3' * * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); }); - * // => logs each number value and returns the object (order is not guaranteed) + * // => logs each number and returns the object (property order is not guaranteed across environments) */ function forEach(collection, callback, thisArg) { var index = -1, @@ -2054,7 +2054,7 @@ * // => [3, 6, 9] * * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); - * // => [3, 6, 9] (order is not guaranteed) + * // => [3, 6, 9] (property order is not guaranteed across environments) * * var stooges = [ * { 'name': 'moe', 'age': 40 }, @@ -3670,9 +3670,7 @@ var isCalled = trailing && (!leading || callCount > 1); clear(); if (isCalled) { - if (maxWait !== false) { - lastCalled = +new Date; - } + lastCalled = +new Date; result = func.apply(thisArg, args); } }; diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 15cbd877c..d04bece9b 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -16,8 +16,8 @@ if(!a&&!x(n))throw new TypeError;if(!o||a||f||c||!(Wr.fastBind||Or&&t.length))p= });return t}function I(n,r,t,e){var u=3>arguments.length;return r=a(r,e,4),k(n,function(n,e,i){t=u?(u=!1,n):r(t,n,e,i)}),t}function W(n,r,t){var e;r=K(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++tt(u,o)&&i.push(o)}return i}function P(n,r,t){if(n){var e=0,u=n.length; if(typeof r!="number"&&null!=r){var i=-1;for(r=K(r,t,3);++ie?kr(0,u+e):e||0}else if(e)return e=G(n,t),n[e]===t?e:-1;return n?r(n,t,e):-1}function V(n,r,t){if(typeof r!="number"&&null!=r){var e=0,u=-1,i=n?n.length:0;for(r=K(r,t,3);++u>>1,t(n[e])o&&(u=n.apply(i,e));else{var t=+new Date;!l&&!s&&(a=t);var p=f-(t-a);0o&&(u=n.apply(i,e));else{var t=+new Date;!l&&!s&&(a=t);var p=f-(t-a);0/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Sr||(v=function(n){if(E(n)){u.prototype=n;var r=new u;u.prototype=null}return r||{}}),m(arguments)||(m=function(n){return n&&typeof n=="object"?xr.call(n,"callee"):!1});var zr=Fr||function(n){return n&&typeof n=="object"?Ar.call(n)==ir:!1},Cr=function(n){var r,t=[]; if(!n||!sr[typeof n])return t;for(r in n)xr.call(n,r)&&t.push(r);return t},Pr=Br?function(n){return E(n)?Br(n):[]}:Cr,Ur={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Vr=w(Ur),Gr=RegExp("("+Pr(Vr).join("|")+")","g"),Hr=RegExp("["+Pr(Ur).join("")+"]","g"),Jr=function(n,r){var t;if(!n||!sr[typeof n])return n;for(t in n)if(r(n[t],t,n)===nr)break;return n},Kr=function(n,r){var t;if(!n||!sr[typeof n])return n;for(t in n)if(xr.call(n,t)&&r(n[t],t,n)===nr)break;return n};x(/x/)&&(x=function(n){return typeof n=="function"&&"[object Function]"==Ar.call(n) diff --git a/doc/README.md b/doc/README.md index 6fa942118..b69670e30 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1061,7 +1061,7 @@ _.isArray(squares.value()); ### `_.chain(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6182 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6180 "View in source") [Ⓣ][1] Creates a `lodash` object that wraps the given `value`. @@ -1094,7 +1094,7 @@ var youngest = _.chain(stooges) ### `_.tap(value, interceptor)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6210 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6208 "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. @@ -1124,7 +1124,7 @@ _([1, 2, 3, 4]) ### `_.prototype.chain()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6230 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6228 "View in source") [Ⓣ][1] Enables method chaining on the wrapper object. @@ -1148,7 +1148,7 @@ var sum = _([1, 2, 3]) ### `_.prototype.toString()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6247 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6245 "View in source") [Ⓣ][1] Produces the `toString` result of the wrapped value. @@ -1169,7 +1169,7 @@ _([1, 2, 3]).toString(); ### `_.prototype.valueOf()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6264 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6262 "View in source") [Ⓣ][1] Extracts the wrapped value. @@ -1492,7 +1492,7 @@ _([1, 2, 3]).forEach(function(num) { console.log(num); }).join(','); // => logs each number and returns '1,2,3' _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); }); -// => logs each number value and returns the object (order is not guaranteed) +// => logs each number and returns the object (property order is not guaranteed across environments) ``` * * * @@ -1664,7 +1664,7 @@ _.map([1, 2, 3], function(num) { return num * 3; }); // => [3, 6, 9] _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); -// => [3, 6, 9] (order is not guaranteed) +// => [3, 6, 9] (property order is not guaranteed across environments) var stooges = [ { 'name': 'moe', 'age': 40 }, @@ -2395,7 +2395,7 @@ source.addEventListener('message', _.debounce(batchLog, 250, { ### `_.defer(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5445 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5443 "View in source") [Ⓣ][1] Defers executing the `func` function until the current call stack has cleared. Additional arguments will be provided to `func` when it is invoked. @@ -2420,7 +2420,7 @@ _.defer(function() { console.log('deferred'); }); ### `_.delay(func, wait [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5479 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5477 "View in source") [Ⓣ][1] Executes the `func` function after `wait` milliseconds. Additional arguments will be provided to `func` when it is invoked. @@ -2447,7 +2447,7 @@ _.delay(log, 1000, 'logged later'); ### `_.memoize(func [, resolver])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5507 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5505 "View in source") [Ⓣ][1] Creates a function that memoizes the result of `func`. If `resolver` is provided it will be used to determine the cache key for storing the result based on the arguments provided to the memoized function. By default, the first argument provided to the memoized function is used as the cache key. The `func` is executed with the `this` binding of the memoized function. The result cache is exposed as the `cache` property on the memoized function. @@ -2473,7 +2473,7 @@ var fibonacci = _.memoize(function(n) { ### `_.once(func)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5540 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5538 "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. @@ -2499,7 +2499,7 @@ initialize(); ### `_.partial(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5578 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5576 "View in source") [Ⓣ][1] Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those provided to the new function. This method is similar to `_.bind` except it does **not** alter the `this` binding. @@ -2526,7 +2526,7 @@ hi('moe'); ### `_.partialRight(func [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5609 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5607 "View in source") [Ⓣ][1] This method is like `_.partial` except that `partial` arguments are appended to those provided to the new function. @@ -2563,7 +2563,7 @@ options.imports ### `_.throttle(func, wait, options)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5644 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5642 "View in source") [Ⓣ][1] Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. Provide an options object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the throttled function will return the result of the last `func` call. @@ -2597,7 +2597,7 @@ jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { ### `_.wrap(value, wrapper)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5688 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5686 "View in source") [Ⓣ][1] Creates a function that provides `value` to the wrapper function as its first argument. Additional arguments provided to the function are appended to those provided to the wrapper function. The wrapper is executed with the `this` binding of the created function. @@ -2807,7 +2807,7 @@ This method is like `_.findIndex` except that it returns the key of the first el _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { return num % 2 == 0; }); -// => 'b' (order is not guaranteed) +// => 'b' (property order is not guaranteed across environments) ``` * * * @@ -2871,7 +2871,7 @@ Dog.prototype.bark = function() { _.forIn(new Dog('Dagny'), function(value, key) { console.log(key); }); -// => logs 'bark' and 'name' (order is not guaranteed) +// => logs 'bark' and 'name' (property order is not guaranteed across environments) ``` * * * @@ -2935,7 +2935,7 @@ Iterates over own enumerable properties of an object, executing the callback for _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { console.log(key); }); -// => logs '0', '1', and 'length' (order is not guaranteed) +// => logs '0', '1', and 'length' (property order is not guaranteed across environments) ``` * * * @@ -3551,7 +3551,7 @@ Creates an array composed of the own enumerable property names of an object. #### Example ```js _.keys({ 'one': 1, 'two': 2, 'three': 3 }); -// => ['one', 'two', 'three'] (order is not guaranteed) +// => ['one', 'two', 'three'] (property order is not guaranteed across environments) ``` * * * @@ -3662,7 +3662,7 @@ Creates a two dimensional array of an object's key-value pairs, i.e. `[[key1, va #### Example ```js _.pairs({ 'moe': 30, 'larry': 40 }); -// => [['moe', 30], ['larry', 40]] (order is not guaranteed) +// => [['moe', 30], ['larry', 40]] (property order is not guaranteed across environments) ``` * * * @@ -3754,7 +3754,7 @@ Creates an array composed of the own enumerable property values of `object`. #### Example ```js _.values({ 'one': 1, 'two': 2, 'three': 3 }); -// => [1, 2, 3] (order is not guaranteed) +// => [1, 2, 3] (property order is not guaranteed across environments) ``` * * * @@ -3772,7 +3772,7 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 }); ### `_.escape(string)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5715 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5713 "View in source") [Ⓣ][1] Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities. @@ -3796,7 +3796,7 @@ _.escape('Moe, Larry & Curly'); ### `_.identity(value)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5733 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5731 "View in source") [Ⓣ][1] This method returns the first argument provided to it. @@ -3821,7 +3821,7 @@ moe === _.identity(moe); ### `_.mixin(object, object)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5760 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5758 "View in source") [Ⓣ][1] Adds function properties of a source object to the `lodash` function and chainable wrapper. @@ -3852,7 +3852,7 @@ _('moe').capitalize(); ### `_.noConflict()` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5798 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5796 "View in source") [Ⓣ][1] Reverts the '_' variable to its previous value and returns a reference to the `lodash` function. @@ -3872,7 +3872,7 @@ var lodash = _.noConflict(); ### `_.parseInt(value [, radix])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5822 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5820 "View in source") [Ⓣ][1] Converts the given `value` into an integer of the specified `radix`. If `radix` is `undefined` or `0` a `radix` of `10` is used unless the `value` is a hexadecimal, in which case a `radix` of `16` is used. @@ -3899,7 +3899,7 @@ _.parseInt('08'); ### `_.random([min=0, max=1])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5846 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5844 "View in source") [Ⓣ][1] Produces a random number between `min` and `max` *(inclusive)*. If only one argument is provided a number between `0` and the given number will be returned. @@ -3927,7 +3927,7 @@ _.random(5); ### `_.result(object, property)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5890 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5888 "View in source") [Ⓣ][1] Resolves the value of `property` on `object`. If `property` is a function it will be invoked with the `this` binding of `object` and its result returned, else the property value is returned. If `object` is falsey then `undefined` is returned. @@ -3980,7 +3980,7 @@ Create a new `lodash` function using the given `context` object. ### `_.template(text, data, options)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5981 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5979 "View in source") [Ⓣ][1] A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code. @@ -4068,7 +4068,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\ ### `_.times(n, callback [, thisArg])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6106 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6104 "View in source") [Ⓣ][1] Executes the callback `n` times, returning an array of the results of each callback execution. The callback is bound to `thisArg` and invoked with one argument; *(index)*. @@ -4100,7 +4100,7 @@ _.times(3, function(n) { this.cast(n); }, mage); ### `_.unescape(string)` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6133 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6131 "View in source") [Ⓣ][1] The inverse of `_.escape` this method converts the HTML entities `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding characters. @@ -4124,7 +4124,7 @@ _.unescape('Moe, Larry & Curly'); ### `_.uniqueId([prefix])` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6153 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6151 "View in source") [Ⓣ][1] Generates a unique ID. If `prefix` is provided the ID will be appended to it. @@ -4177,7 +4177,7 @@ A reference to the `lodash` function. ### `_.VERSION` -# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6460 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6458 "View in source") [Ⓣ][1] *(String)*: The semantic version number. diff --git a/lodash.js b/lodash.js index 38021f38a..176c5e624 100644 --- a/lodash.js +++ b/lodash.js @@ -1762,7 +1762,7 @@ * @example * * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); - * // => ['one', 'two', 'three'] (order is not guaranteed) + * // => ['one', 'two', 'three'] (property order is not guaranteed across environments) */ var keys = !nativeKeys ? shimKeys : function(object) { if (!isObject(object)) { @@ -2025,7 +2025,7 @@ * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { * return num % 2 == 0; * }); - * // => 'b' (order is not guaranteed) + * // => 'b' (property order is not guaranteed across environments) */ function findKey(object, callback, thisArg) { var result; @@ -2098,7 +2098,7 @@ * _.forIn(new Dog('Dagny'), function(value, key) { * console.log(key); * }); - * // => logs 'bark' and 'name' (order is not guaranteed) + * // => logs 'bark' and 'name' (property order is not guaranteed across environments) */ var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, { 'useHas': false @@ -2166,7 +2166,7 @@ * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { * console.log(key); * }); - * // => logs '0', '1', and 'length' (order is not guaranteed) + * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) */ var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions); @@ -2785,7 +2785,7 @@ * @example * * _.pairs({ 'moe': 30, 'larry': 40 }); - * // => [['moe', 30], ['larry', 40]] (order is not guaranteed) + * // => [['moe', 30], ['larry', 40]] (property order is not guaranteed across environments) */ function pairs(object) { var index = -1, @@ -2913,7 +2913,7 @@ * @example * * _.values({ 'one': 1, 'two': 2, 'three': 3 }); - * // => [1, 2, 3] (order is not guaranteed) + * // => [1, 2, 3] (property order is not guaranteed across environments) */ function values(object) { var index = -1, @@ -3298,7 +3298,7 @@ * // => logs each number and returns '1,2,3' * * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); }); - * // => logs each number value and returns the object (order is not guaranteed) + * // => logs each number and returns the object (property order is not guaranteed across environments) */ function forEach(collection, callback, thisArg) { if (callback && typeof thisArg == 'undefined' && isArray(collection)) { @@ -3496,7 +3496,7 @@ * // => [3, 6, 9] * * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); - * // => [3, 6, 9] (order is not guaranteed) + * // => [3, 6, 9] (property order is not guaranteed across environments) * * var stooges = [ * { 'name': 'moe', 'age': 40 },