|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
614 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Checks if `value` is object-like. A value is object-like if it's not `null`
|
|---|
| 3 | * and has a `typeof` result of "object".
|
|---|
| 4 | *
|
|---|
| 5 | * @static
|
|---|
| 6 | * @memberOf _
|
|---|
| 7 | * @since 4.0.0
|
|---|
| 8 | * @category Lang
|
|---|
| 9 | * @param {*} value The value to check.
|
|---|
| 10 | * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|---|
| 11 | * @example
|
|---|
| 12 | *
|
|---|
| 13 | * _.isObjectLike({});
|
|---|
| 14 | * // => true
|
|---|
| 15 | *
|
|---|
| 16 | * _.isObjectLike([1, 2, 3]);
|
|---|
| 17 | * // => true
|
|---|
| 18 | *
|
|---|
| 19 | * _.isObjectLike(_.noop);
|
|---|
| 20 | * // => false
|
|---|
| 21 | *
|
|---|
| 22 | * _.isObjectLike(null);
|
|---|
| 23 | * // => false
|
|---|
| 24 | */
|
|---|
| 25 | function isObjectLike(value) {
|
|---|
| 26 | return value != null && typeof value == 'object';
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | module.exports = isObjectLike;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.