UNPKG

721 BJavaScriptView Raw
1import baseValues from './_baseValues.js';
2import keysIn from './keysIn.js';
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
32export default valuesIn;