@domql/utils 2.3.18 → 2.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/types.js +5 -5
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/utils",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.20",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@domql/globals": "latest",
|
|
8
8
|
"@domql/tags": "latest"
|
|
9
9
|
},
|
|
10
|
-
"gitHead": "
|
|
10
|
+
"gitHead": "e3a1ae560ae4606c7db7ee7108380ff29dfc291b"
|
|
11
11
|
}
|
package/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { global } from '@domql/globals'
|
|
4
4
|
import { HTML_TAGS } from '@domql/tags'
|
|
5
5
|
|
|
6
6
|
export const isValidHtmlTag = arg => HTML_TAGS.body.indexOf(arg)
|
|
@@ -30,16 +30,16 @@ export const isObjectLike = arg => {
|
|
|
30
30
|
|
|
31
31
|
export const isNode = obj => {
|
|
32
32
|
return (
|
|
33
|
-
typeof
|
|
34
|
-
? obj instanceof
|
|
33
|
+
typeof global.Node === 'object'
|
|
34
|
+
? obj instanceof global.Node
|
|
35
35
|
: obj && typeof obj === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string'
|
|
36
36
|
)
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export const isHtmlElement = obj => {
|
|
40
40
|
return (
|
|
41
|
-
typeof
|
|
42
|
-
? obj instanceof
|
|
41
|
+
typeof global.HTMLElement === 'object'
|
|
42
|
+
? obj instanceof global.HTMLElement // DOM2
|
|
43
43
|
: obj && typeof obj === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string'
|
|
44
44
|
)
|
|
45
45
|
}
|