UNPKG

614 BJavaScriptView Raw
1export const isObj = (obj) => {
2 return Object.prototype.toString.call(obj) === '[object Object]';
3};
4
5export const isFun = (obj) => {
6 return Object.prototype.toString.call(obj) === '[object Function]';
7};
8
9export const isArray = (obj) => {
10 return Object.prototype.toString.call(obj) === '[object Array]';
11};
12
13export const isStr = (str) => {
14 return Object.prototype.toString.call(str) === '[object String]';
15};
16
17export const isNum = (num) => {
18 return Object.prototype.toString.call(num) === '[object Number]';
19};
20
21export const isEmptyObj = (obj) => {
22 return JSON.stringify(obj) === '{}';
23};