index.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/>
  3. * Build: `lodash modularize modern exports="npm" -o ./npm/`
  4. * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
  5. * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
  6. * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  7. * Available under MIT license <http://lodash.com/license>
  8. */
  9. var keys = require('lodash.keys');
  10. /**
  11. * Creates an array composed of the own enumerable property values of `object`.
  12. *
  13. * @static
  14. * @memberOf _
  15. * @category Objects
  16. * @param {Object} object The object to inspect.
  17. * @returns {Array} Returns an array of property values.
  18. * @example
  19. *
  20. * _.values({ 'one': 1, 'two': 2, 'three': 3 });
  21. * // => [1, 2, 3] (property order is not guaranteed across environments)
  22. */
  23. function values(object) {
  24. var index = -1,
  25. props = keys(object),
  26. length = props.length,
  27. result = Array(length);
  28. while (++index < length) {
  29. result[index] = object[props[index]];
  30. }
  31. return result;
  32. }
  33. module.exports = values;