1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | module.exports = {
|
7 | array : typeof [],
|
8 | object: typeof {},
|
9 | function : typeof Function,
|
10 | number : typeof 1,
|
11 | boolean : typeof true,
|
12 | symbol : typeof Symbol(),
|
13 | string : typeof '',
|
14 |
|
15 | isObject (val) {
|
16 | return (val !== undefined) && val.constructor === Object;
|
17 | },
|
18 |
|
19 | isNotObject (val) {
|
20 | return !this.isObject(val);
|
21 | },
|
22 |
|
23 | isArray (val) {
|
24 | return (val !== undefined) && val.constructor === Array;
|
25 | },
|
26 |
|
27 | isNotArray (val) {
|
28 | return !this.isArray(val);
|
29 | }
|
30 |
|
31 | };
|