UNPKG

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