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:
33
react-app/node_modules/lodash/object/pairs.js
generated
vendored
Normal file
33
react-app/node_modules/lodash/object/pairs.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
var keys = require('./keys'),
|
||||
toObject = require('../internal/toObject');
|
||||
|
||||
/**
|
||||
* Creates a two dimensional array of the key-value pairs for `object`,
|
||||
* e.g. `[[key1, value1], [key2, value2]]`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Object
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the new array of key-value pairs.
|
||||
* @example
|
||||
*
|
||||
* _.pairs({ 'barney': 36, 'fred': 40 });
|
||||
* // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
|
||||
*/
|
||||
function pairs(object) {
|
||||
object = toObject(object);
|
||||
|
||||
var index = -1,
|
||||
props = keys(object),
|
||||
length = props.length,
|
||||
result = Array(length);
|
||||
|
||||
while (++index < length) {
|
||||
var key = props[index];
|
||||
result[index] = [key, object[key]];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = pairs;
|
Reference in New Issue
Block a user