1 | ;
|
2 |
|
3 | /**
|
4 | * Copyright (c) Facebook, Inc. and its affiliates.
|
5 | *
|
6 | * This source code is licensed under the MIT license found in the
|
7 | * LICENSE file in the root directory of this source tree.
|
8 | *
|
9 | * @format
|
10 | *
|
11 | * @emails oncall+draft_js
|
12 | */
|
13 | function isHTMLElement(node) {
|
14 | if (!node || !node.ownerDocument) {
|
15 | return false;
|
16 | }
|
17 |
|
18 | if (!node.ownerDocument.defaultView) {
|
19 | return node instanceof HTMLElement;
|
20 | }
|
21 |
|
22 | if (node instanceof node.ownerDocument.defaultView.HTMLElement) {
|
23 | return true;
|
24 | }
|
25 |
|
26 | return false;
|
27 | }
|
28 |
|
29 | module.exports = isHTMLElement; |
\ | No newline at end of file |