wallet-core/node_modules/lodash/_baseAt.js

24 lines
581 B
JavaScript
Raw Normal View History

2016-10-10 03:43:44 +02:00
var get = require('./get');
/**
* The base implementation of `_.at` without support for individual paths.
*
* @private
* @param {Object} object The object to iterate over.
* @param {string[]} paths The property paths of elements to pick.
* @returns {Array} Returns the picked elements.
*/
function baseAt(object, paths) {
var index = -1,
length = paths.length,
2016-11-03 01:33:53 +01:00
result = Array(length),
skip = object == null;
2016-10-10 03:43:44 +02:00
while (++index < length) {
2016-11-03 01:33:53 +01:00
result[index] = skip ? undefined : get(object, paths[index]);
2016-10-10 03:43:44 +02:00
}
return result;
}
module.exports = baseAt;