mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Simplify functions.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import baseFunctions from './.internal/baseFunctions.js'
|
||||
import arrayFilter from './arrayFilter.js'
|
||||
import keys from './keys.js'
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,9 @@ import keys from './keys.js'
|
||||
* // => ['a', 'b']
|
||||
*/
|
||||
function functions(object) {
|
||||
return object == null ? [] : baseFunctions(object, keys(object))
|
||||
return object == null
|
||||
? []
|
||||
: arrayFilter(keys(object), key => typeof object[key] == 'function')
|
||||
}
|
||||
|
||||
export default functions
|
||||
|
||||
Reference in New Issue
Block a user