1 | export function objectOrFunction(x) {
|
2 | let type = typeof x;
|
3 | return x !== null && (type === 'object' || type === 'function');
|
4 | }
|
5 |
|
6 | export function isFunction(x) {
|
7 | return typeof x === 'function';
|
8 | }
|
9 |
|
10 | export function isMaybeThenable(x) {
|
11 | return x !== null && typeof x === 'object';
|
12 | }
|
13 |
|
14 | let _isArray;
|
15 | if (Array.isArray) {
|
16 | _isArray = Array.isArray;
|
17 | } else {
|
18 | _isArray = x => Object.prototype.toString.call(x) === '[object Array]';
|
19 | }
|
20 |
|
21 | export const isArray = _isArray;
|