main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
572 bytes
|
Line | |
---|
1 | import isObjectLike from './isObjectLike.js';
|
---|
2 | import isPlainObject from './isPlainObject.js';
|
---|
3 |
|
---|
4 | /**
|
---|
5 | * Checks if `value` is likely a DOM element.
|
---|
6 | *
|
---|
7 | * @static
|
---|
8 | * @memberOf _
|
---|
9 | * @since 0.1.0
|
---|
10 | * @category Lang
|
---|
11 | * @param {*} value The value to check.
|
---|
12 | * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
|
---|
13 | * @example
|
---|
14 | *
|
---|
15 | * _.isElement(document.body);
|
---|
16 | * // => true
|
---|
17 | *
|
---|
18 | * _.isElement('<body>');
|
---|
19 | * // => false
|
---|
20 | */
|
---|
21 | function isElement(value) {
|
---|
22 | return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
|
---|
23 | }
|
---|
24 |
|
---|
25 | export default isElement;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.