Remove baseGetAllKeys.

This commit is contained in:
John-David Dalton
2017-01-10 19:25:52 -08:00
parent e52c421c1d
commit e45db2e507
3 changed files with 4 additions and 23 deletions

View File

@@ -1,19 +0,0 @@
import arrayPush from './.internal/arrayPush.js';
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Function} keysFunc The function to get the keys of `object`.
* @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
const result = keysFunc(object);
return Array.isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
export default baseGetAllKeys;

View File

@@ -1,4 +1,3 @@
import baseGetAllKeys from './.internal/baseGetAllKeys.js';
import getSymbols from './.internal/getSymbols.js';
import keys from './keys.js';
@@ -10,7 +9,8 @@ import keys from './keys.js';
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
const result = keys(object);
return Array.isArray(object) ? result : arrayPush(result, getSymbols(object));
}
export default getAllKeys;

View File

@@ -1,4 +1,3 @@
import baseGetAllKeys from './.internal/baseGetAllKeys.js';
import getSymbolsIn from './.internal/getSymbolsIn.js';
import keysIn from './keysIn.js';
@@ -11,7 +10,8 @@ import keysIn from './keysIn.js';
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeysIn(object) {
return baseGetAllKeys(object, keysIn, getSymbolsIn);
const result = keysIn(object);
return Array.isArray(object) ? result : arrayPush(result, getSymbolsIn(object));
}
export default getAllKeysIn;