mirror of
https://github.com/status-im/react-native.git
synced 2025-01-19 14:02:10 +00:00
8f5ebe5952
Reviewed By: sahrens Differential Revision: D7956042 fbshipit-source-id: 221851aa311f3cdd6326497352b366048db0a1bb
29 lines
650 B
JavaScript
29 lines
650 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @typechecks
|
|
*/
|
|
'use strict';
|
|
|
|
/**
|
|
* Retrieve an object's values as an array.
|
|
*
|
|
* If you are looking for a function that creates an Array instance based
|
|
* on an "Array-like" object, use createArrayFrom instead.
|
|
*
|
|
* @param {object} obj An object.
|
|
* @return {array} The object's values.
|
|
*/
|
|
function getObjectValues(obj) {
|
|
const values = [];
|
|
for (const key in obj) {
|
|
values.push(obj[key]);
|
|
}
|
|
return values;
|
|
}
|
|
|
|
module.exports = getObjectValues;
|