Remove arrayPush in favor of spreading arguments.

This commit is contained in:
John-David Dalton
2017-02-21 10:34:25 -08:00
parent 0350d4904f
commit 56b7d339a6
5 changed files with 11 additions and 30 deletions

View File

@@ -1,10 +1,8 @@
import arrayPush from './arrayPush.js'
import getSymbolsIn from './getSymbolsIn.js'
import keysIn from '../keysIn.js'
/**
* Creates an array of own and inherited enumerable property names and
* symbols of `object`.
* Creates an array of own and inherited enumerable property names and symbols of `object`.
*
* @private
* @param {Object} object The object to query.
@@ -12,7 +10,10 @@ import keysIn from '../keysIn.js'
*/
function getAllKeysIn(object) {
const result = keysIn(object)
return Array.isArray(object) ? result : arrayPush(result, getSymbolsIn(object))
if (!Array.isArray(object)) {
result.push(...getSymbolsIn(object))
}
return result
}
export default getAllKeysIn