File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
export function objectOrFunction ( x ) {
2
- return typeof x === 'function' || ( typeof x === 'object' && x !== null ) ;
2
+ let type = typeof x ;
3
+ return x !== null && ( type === 'object' || type === 'function' ) ;
3
4
}
4
5
5
6
export function isFunction ( x ) {
6
7
return typeof x === 'function' ;
7
8
}
8
9
9
10
export function isMaybeThenable ( x ) {
10
- return typeof x === 'object' && x !== null ;
11
+ return x !== null && typeof x === 'object' ;
11
12
}
12
13
13
14
let _isArray ;
14
- if ( ! Array . isArray ) {
15
- _isArray = x => Object . prototype . toString . call ( x ) === '[object Array]' ;
16
- } else {
15
+ if ( Array . isArray ) {
17
16
_isArray = Array . isArray ;
17
+ } else {
18
+ _isArray = x => Object . prototype . toString . call ( x ) === '[object Array]' ;
18
19
}
19
20
20
21
export const isArray = _isArray ;
You can’t perform that action at this time.
0 commit comments