UNPKG

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