mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Remove baseGetAllKeys.
This commit is contained in:
@@ -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;
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import baseGetAllKeys from './.internal/baseGetAllKeys.js';
|
|
||||||
import getSymbols from './.internal/getSymbols.js';
|
import getSymbols from './.internal/getSymbols.js';
|
||||||
import keys from './keys.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.
|
* @returns {Array} Returns the array of property names and symbols.
|
||||||
*/
|
*/
|
||||||
function getAllKeys(object) {
|
function getAllKeys(object) {
|
||||||
return baseGetAllKeys(object, keys, getSymbols);
|
const result = keys(object);
|
||||||
|
return Array.isArray(object) ? result : arrayPush(result, getSymbols(object));
|
||||||
}
|
}
|
||||||
|
|
||||||
export default getAllKeys;
|
export default getAllKeys;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import baseGetAllKeys from './.internal/baseGetAllKeys.js';
|
|
||||||
import getSymbolsIn from './.internal/getSymbolsIn.js';
|
import getSymbolsIn from './.internal/getSymbolsIn.js';
|
||||||
import keysIn from './keysIn.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.
|
* @returns {Array} Returns the array of property names and symbols.
|
||||||
*/
|
*/
|
||||||
function getAllKeysIn(object) {
|
function getAllKeysIn(object) {
|
||||||
return baseGetAllKeys(object, keysIn, getSymbolsIn);
|
const result = keysIn(object);
|
||||||
|
return Array.isArray(object) ? result : arrayPush(result, getSymbolsIn(object));
|
||||||
}
|
}
|
||||||
|
|
||||||
export default getAllKeysIn;
|
export default getAllKeysIn;
|
||||||
|
|||||||
Reference in New Issue
Block a user