@domql/utils 2.3.93 → 2.3.100
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/dist/cjs/node.js +6 -13
- package/dist/cjs/types.js +1 -1
- package/node.js +13 -14
- package/package.json +2 -2
- package/types.js +1 -1
package/dist/cjs/node.js
CHANGED
|
@@ -18,18 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var node_exports = {};
|
|
20
20
|
__export(node_exports, {
|
|
21
|
-
|
|
22
|
-
createID: () => createID,
|
|
23
|
-
createSnapshotId: () => createSnapshotId
|
|
21
|
+
isNode: () => isNode
|
|
24
22
|
});
|
|
25
23
|
module.exports = __toCommonJS(node_exports);
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
return index;
|
|
32
|
-
}
|
|
33
|
-
return newId;
|
|
34
|
-
}();
|
|
35
|
-
const createSnapshotId = createID;
|
|
24
|
+
var import_globals = require("@domql/globals");
|
|
25
|
+
const isNode = (node) => {
|
|
26
|
+
const { Node } = import_globals.window;
|
|
27
|
+
return typeof Node === "function" ? node instanceof Node : node && typeof node === "object" && typeof node.nodeType === "number" && typeof node.tag === "string";
|
|
28
|
+
};
|
package/dist/cjs/types.js
CHANGED
|
@@ -38,7 +38,7 @@ __export(types_exports, {
|
|
|
38
38
|
module.exports = __toCommonJS(types_exports);
|
|
39
39
|
var import_globals = require("@domql/globals");
|
|
40
40
|
var import_tags = require("@domql/tags");
|
|
41
|
-
const isValidHtmlTag = (arg) => import_tags.HTML_TAGS.body.
|
|
41
|
+
const isValidHtmlTag = (arg) => import_tags.HTML_TAGS.body.includes(arg);
|
|
42
42
|
const isObject = (arg) => {
|
|
43
43
|
if (arg === null)
|
|
44
44
|
return false;
|
package/node.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export const createSnapshotId = createID
|
|
3
|
+
import { window } from '@domql/globals'
|
|
4
|
+
|
|
5
|
+
export const isNode = (node) => {
|
|
6
|
+
const { Node } = window
|
|
7
|
+
return (
|
|
8
|
+
typeof Node === 'function'
|
|
9
|
+
? node instanceof Node
|
|
10
|
+
: node &&
|
|
11
|
+
typeof node === 'object' &&
|
|
12
|
+
typeof node.nodeType === 'number' &&
|
|
13
|
+
typeof node.tag === 'string'
|
|
14
|
+
)
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/utils",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.100",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"@domql/globals": "latest",
|
|
23
23
|
"@domql/tags": "latest"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "4d65ad04e488122bfc73ec81dc16c45b842ffa9b"
|
|
26
26
|
}
|
package/types.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { window } from '@domql/globals'
|
|
4
4
|
import { HTML_TAGS } from '@domql/tags'
|
|
5
5
|
|
|
6
|
-
export const isValidHtmlTag = arg => HTML_TAGS.body.
|
|
6
|
+
export const isValidHtmlTag = arg => HTML_TAGS.body.includes(arg)
|
|
7
7
|
|
|
8
8
|
export const isObject = arg => {
|
|
9
9
|
if (arg === null) return false
|