mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
32
react-app/node_modules/lodash/lang/toArray.js
generated
vendored
Normal file
32
react-app/node_modules/lodash/lang/toArray.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
var arrayCopy = require('../internal/arrayCopy'),
|
||||
getLength = require('../internal/getLength'),
|
||||
isLength = require('../internal/isLength'),
|
||||
values = require('../object/values');
|
||||
|
||||
/**
|
||||
* Converts `value` to an array.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {*} value The value to convert.
|
||||
* @returns {Array} Returns the converted array.
|
||||
* @example
|
||||
*
|
||||
* (function() {
|
||||
* return _.toArray(arguments).slice(1);
|
||||
* }(1, 2, 3));
|
||||
* // => [2, 3]
|
||||
*/
|
||||
function toArray(value) {
|
||||
var length = value ? getLength(value) : 0;
|
||||
if (!isLength(length)) {
|
||||
return values(value);
|
||||
}
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
return arrayCopy(value);
|
||||
}
|
||||
|
||||
module.exports = toArray;
|
Reference in New Issue
Block a user