mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Remove baseForOwn from several modules.
This commit is contained in:
10
functions.js
10
functions.js
@@ -1,6 +1,3 @@
|
||||
import arrayFilter from './arrayFilter.js'
|
||||
import keys from './keys.js'
|
||||
|
||||
/**
|
||||
* Creates an array of function property names from own enumerable properties
|
||||
* of `object`.
|
||||
@@ -23,9 +20,10 @@ import keys from './keys.js'
|
||||
* // => ['a', 'b']
|
||||
*/
|
||||
function functions(object) {
|
||||
return object == null
|
||||
? []
|
||||
: arrayFilter(keys(object), key => typeof object[key] == 'function')
|
||||
if (object == null) {
|
||||
return []
|
||||
}
|
||||
return Object.keys(object).filter((key) => typeof object[key] == 'function')
|
||||
}
|
||||
|
||||
export default functions
|
||||
|
||||
Reference in New Issue
Block a user