您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

_baseAt.js 569B

1234567891011121314151617181920212223
  1. var get = require('./get');
  2. /**
  3. * The base implementation of `_.at` without support for individual paths.
  4. *
  5. * @private
  6. * @param {Object} object The object to iterate over.
  7. * @param {string[]} paths The property paths to pick.
  8. * @returns {Array} Returns the picked elements.
  9. */
  10. function baseAt(object, paths) {
  11. var index = -1,
  12. length = paths.length,
  13. result = Array(length),
  14. skip = object == null;
  15. while (++index < length) {
  16. result[index] = skip ? undefined : get(object, paths[index]);
  17. }
  18. return result;
  19. }
  20. module.exports = baseAt;