lodash._basefor
Advanced tools
Comparing version 3.0.2 to 3.0.3
58
index.js
/** | ||
* lodash 3.0.2 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modern modularize exports="npm" -o ./` | ||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
* lodash 3.0.3 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <https://lodash.com/license> | ||
@@ -25,3 +25,3 @@ */ | ||
/** | ||
* Creates a base function for `_.forIn` or `_.forInRight`. | ||
* Creates a base function for methods like `_.forIn`. | ||
* | ||
@@ -34,9 +34,9 @@ * @private | ||
return function(object, iteratee, keysFunc) { | ||
var iterable = toObject(object), | ||
var index = -1, | ||
iterable = Object(object), | ||
props = keysFunc(object), | ||
length = props.length, | ||
index = fromRight ? length : -1; | ||
length = props.length; | ||
while ((fromRight ? index-- : ++index < length)) { | ||
var key = props[index]; | ||
while (length--) { | ||
var key = props[fromRight ? length : ++index]; | ||
if (iteratee(iterable[key], key, iterable) === false) { | ||
@@ -50,40 +50,2 @@ break; | ||
/** | ||
* Converts `value` to an object if it's not one. | ||
* | ||
* @private | ||
* @param {*} value The value to process. | ||
* @returns {Object} Returns the object. | ||
*/ | ||
function toObject(value) { | ||
return isObject(value) ? value : Object(value); | ||
} | ||
/** | ||
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. | ||
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is an object, else `false`. | ||
* @example | ||
* | ||
* _.isObject({}); | ||
* // => true | ||
* | ||
* _.isObject([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isObject(1); | ||
* // => false | ||
*/ | ||
function isObject(value) { | ||
// Avoid a V8 JIT bug in Chrome 19-20. | ||
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details. | ||
var type = typeof value; | ||
return !!value && (type == 'object' || type == 'function'); | ||
} | ||
module.exports = baseFor; |
{ | ||
"name": "lodash._basefor", | ||
"version": "3.0.2", | ||
"description": "The modern build of lodash’s internal `baseFor` as a module.", | ||
"version": "3.0.3", | ||
"description": "The internal lodash function `baseFor` exported as a module.", | ||
"homepage": "https://lodash.com/", | ||
@@ -11,5 +11,3 @@ "icon": "https://lodash.com/icon.svg", | ||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)", | ||
"Benjamin Tan <demoneaux@gmail.com> (https://d10.github.io/)", | ||
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)", | ||
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)", | ||
"Blaine Bublitz <blaine@iceddev.com> (https://github.com/phated)", | ||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" | ||
@@ -16,0 +14,0 @@ ], |
@@ -1,4 +0,4 @@ | ||
# lodash._basefor v3.0.2 | ||
# lodash._basefor v3.0.3 | ||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseFor` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. | ||
The internal [lodash](https://lodash.com/) function `baseFor` exported as a [Node.js](https://nodejs.org/) module. | ||
@@ -8,3 +8,2 @@ ## Installation | ||
Using npm: | ||
```bash | ||
@@ -15,4 +14,3 @@ $ {sudo -H} npm i -g npm | ||
In Node.js/io.js: | ||
In Node.js: | ||
```js | ||
@@ -22,2 +20,2 @@ var baseFor = require('lodash._basefor'); | ||
See the [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash._basefor) for more details. | ||
See the [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash._basefor) for more details. |
3921
44
19