17 lines
423 B
JavaScript
17 lines
423 B
JavaScript
//#region src/compat/object/values.ts
|
|
/**
|
|
* Creates an array of the own enumerable property values of `object`.
|
|
*
|
|
* @param {any} object The object to query.
|
|
* @returns {any[]} Returns an array of property values.
|
|
* @example
|
|
* const obj = { a: 1, b: 2, c: 3 };
|
|
* values(obj); // => [1, 2, 3]
|
|
*/
|
|
function values(object) {
|
|
if (object == null) return [];
|
|
return Object.values(object);
|
|
}
|
|
//#endregion
|
|
exports.values = values;
|