1 | # is-obj
|
2 |
|
3 | > Check if a value is an object
|
4 |
|
5 | Keep in mind that array, function, regexp, etc, are objects in JavaScript.
|
6 |
|
7 | See [`is-plain-obj`](https://github.com/sindresorhus/is-plain-obj) if you want to check for plain objects.
|
8 |
|
9 | ## Install
|
10 |
|
11 | ```
|
12 | $ npm install is-obj
|
13 | ```
|
14 |
|
15 | ## Usage
|
16 |
|
17 | ```js
|
18 | import isObject from 'is-obj';
|
19 |
|
20 | isObject({foo: 'bar'});
|
21 | //=> true
|
22 |
|
23 | isObject([1, 2, 3]);
|
24 | //=> true
|
25 |
|
26 | isObject('foo');
|
27 | //=> false
|
28 | ```
|
29 |
|
30 | ## Related
|
31 |
|
32 | - [is](https://github.com/sindresorhus/is) - Type check values
|
33 |
|
34 | ---
|
35 |
|
36 | <div align="center">
|
37 | <b>
|
38 | <a href="https://tidelift.com/subscription/pkg/npm-is-obj?utm_source=npm-is-obj&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
39 | </b>
|
40 | <br>
|
41 | <sub>
|
42 | Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
43 | </sub>
|
44 | </div>
|