getAllKeys.js 524 Bytes
Newer Older
1 2
import getSymbols from './getSymbols.js';
import keys from './keys.js';
徐立's avatar
徐立 committed
3 4 5 6 7 8 9 10 11

/**
 * Creates an array of own enumerable property names and symbols of `object`.
 * 创建自己的可枚举属性名和“对象”符号的数组。
 * @private
 * @param {Object} object 要查询的对象。
 * @returns {Array} 返回属性名和符号的数组。
 */
function getAllKeys(object) {
12 13 14 15 16
	const result = keys(object);
	if (!Array.isArray(object)) {
		result.push(...getSymbols(object));
	}
	return result;
徐立's avatar
徐立 committed
17 18
}

19
export default getAllKeys;