You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
723 B

4 years ago
  1. var baseValues = require('./_baseValues'),
  2. keysIn = require('./keysIn');
  3. /**
  4. * Creates an array of the own and inherited enumerable string keyed property
  5. * values of `object`.
  6. *
  7. * **Note:** Non-object values are coerced to objects.
  8. *
  9. * @static
  10. * @memberOf _
  11. * @since 3.0.0
  12. * @category Object
  13. * @param {Object} object The object to query.
  14. * @returns {Array} Returns the array of property values.
  15. * @example
  16. *
  17. * function Foo() {
  18. * this.a = 1;
  19. * this.b = 2;
  20. * }
  21. *
  22. * Foo.prototype.c = 3;
  23. *
  24. * _.valuesIn(new Foo);
  25. * // => [1, 2, 3] (iteration order is not guaranteed)
  26. */
  27. function valuesIn(object) {
  28. return object == null ? [] : baseValues(object, keysIn(object));
  29. }
  30. module.exports = valuesIn;