valuesIn.js 723 B

1234567891011121314151617181920212223242526272829303132
  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;