mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
more work
This commit is contained in:
23
node_modules/lodash/internal/toIterable.js
generated
vendored
Normal file
23
node_modules/lodash/internal/toIterable.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
var getLength = require('./getLength'),
|
||||
isLength = require('./isLength'),
|
||||
isObject = require('../lang/isObject'),
|
||||
values = require('../object/values');
|
||||
|
||||
/**
|
||||
* Converts `value` to an array-like object if it is not one.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to process.
|
||||
* @returns {Array|Object} Returns the array-like object.
|
||||
*/
|
||||
function toIterable(value) {
|
||||
if (value == null) {
|
||||
return [];
|
||||
}
|
||||
if (!isLength(getLength(value))) {
|
||||
return values(value);
|
||||
}
|
||||
return isObject(value) ? value : Object(value);
|
||||
}
|
||||
|
||||
module.exports = toIterable;
|
Reference in New Issue
Block a user