@oscarpalmer/toretto 0.16.0 → 0.17.0
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/attribute.cjs +1 -1
- package/dist/attribute.js +1 -1
- package/dist/focusable.cjs +1 -2
- package/dist/focusable.js +1 -2
- package/dist/sanitise.cjs +3 -1
- package/dist/sanitise.js +3 -1
- package/package.json +11 -18
- package/src/attribute.ts +1 -1
- package/src/sanitise.ts +3 -1
package/dist/attribute.cjs
CHANGED
|
@@ -42,7 +42,7 @@ function isEmptyNonBooleanAttribute(attribute) {
|
|
|
42
42
|
}
|
|
43
43
|
function isInvalidBooleanAttribute(attribute) {
|
|
44
44
|
if (!booleanAttributes.includes(attribute.name)) {
|
|
45
|
-
return
|
|
45
|
+
return false;
|
|
46
46
|
}
|
|
47
47
|
const normalised = attribute.value.toLowerCase().trim();
|
|
48
48
|
return !(normalised.length === 0 || normalised === attribute.name);
|
package/dist/attribute.js
CHANGED
|
@@ -40,7 +40,7 @@ function isEmptyNonBooleanAttribute(attribute) {
|
|
|
40
40
|
}
|
|
41
41
|
function isInvalidBooleanAttribute(attribute) {
|
|
42
42
|
if (!booleanAttributes.includes(attribute.name)) {
|
|
43
|
-
return
|
|
43
|
+
return false;
|
|
44
44
|
}
|
|
45
45
|
const normalised = attribute.value.toLowerCase().trim();
|
|
46
46
|
return !(normalised.length === 0 || normalised === attribute.name);
|
package/dist/focusable.cjs
CHANGED
|
@@ -122,8 +122,7 @@ function isHidden(item) {
|
|
|
122
122
|
}
|
|
123
123
|
function isInert(item) {
|
|
124
124
|
return (item.element.inert ?? false) || /^(|true)$/i.test(item.element.getAttribute("inert")) || item.element.parentElement != null && isInert({
|
|
125
|
-
element: item.element.parentElement
|
|
126
|
-
tabIndex: -1
|
|
125
|
+
element: item.element.parentElement
|
|
127
126
|
});
|
|
128
127
|
}
|
|
129
128
|
function isNotTabbable(item) {
|
package/dist/focusable.js
CHANGED
|
@@ -120,8 +120,7 @@ function isHidden(item) {
|
|
|
120
120
|
}
|
|
121
121
|
function isInert(item) {
|
|
122
122
|
return (item.element.inert ?? false) || /^(|true)$/i.test(item.element.getAttribute("inert")) || item.element.parentElement != null && isInert({
|
|
123
|
-
element: item.element.parentElement
|
|
124
|
-
tabIndex: -1
|
|
123
|
+
element: item.element.parentElement
|
|
125
124
|
});
|
|
126
125
|
}
|
|
127
126
|
function isNotTabbable(item) {
|
package/dist/sanitise.cjs
CHANGED
|
@@ -24,7 +24,9 @@ function sanitiseNodes(nodes, options) {
|
|
|
24
24
|
if (node instanceof Element) {
|
|
25
25
|
sanitiseAttributes(node, [...node.attributes], options);
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
if (node.hasChildNodes()) {
|
|
28
|
+
sanitiseNodes([...node.childNodes], options);
|
|
29
|
+
}
|
|
28
30
|
}
|
|
29
31
|
return nodes;
|
|
30
32
|
}
|
package/dist/sanitise.js
CHANGED
|
@@ -22,7 +22,9 @@ function sanitiseNodes(nodes, options) {
|
|
|
22
22
|
if (node instanceof Element) {
|
|
23
23
|
sanitiseAttributes(node, [...node.attributes], options);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
if (node.hasChildNodes()) {
|
|
26
|
+
sanitiseNodes([...node.childNodes], options);
|
|
27
|
+
}
|
|
26
28
|
}
|
|
27
29
|
return nodes;
|
|
28
30
|
}
|
package/package.json
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
"url": "https://oscarpalmer.se"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@oscarpalmer/atoms": "^0.
|
|
7
|
+
"@oscarpalmer/atoms": "^0.82"
|
|
8
8
|
},
|
|
9
9
|
"description": "A collection of badass DOM utilities.",
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@biomejs/biome": "^1.9",
|
|
12
|
-
"@types/node": "^22.
|
|
13
|
-
"@vitest/coverage-istanbul": "^
|
|
12
|
+
"@types/node": "^22.13",
|
|
13
|
+
"@vitest/coverage-istanbul": "^3",
|
|
14
14
|
"dts-bundle-generator": "^9.5",
|
|
15
15
|
"glob": "^11",
|
|
16
|
-
"happy-dom": "^
|
|
17
|
-
"typescript": "^5.
|
|
18
|
-
"vite": "^
|
|
19
|
-
"vitest": "^
|
|
16
|
+
"happy-dom": "^16.8",
|
|
17
|
+
"typescript": "^5.7",
|
|
18
|
+
"vite": "^6",
|
|
19
|
+
"vitest": "^3"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
@@ -128,15 +128,8 @@
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
|
-
"files": [
|
|
132
|
-
|
|
133
|
-
"src",
|
|
134
|
-
"types"
|
|
135
|
-
],
|
|
136
|
-
"keywords": [
|
|
137
|
-
"dom",
|
|
138
|
-
"utility"
|
|
139
|
-
],
|
|
131
|
+
"files": ["dist", "src", "types"],
|
|
132
|
+
"keywords": ["dom", "utility"],
|
|
140
133
|
"license": "MIT",
|
|
141
134
|
"main": "dist/index.cjs",
|
|
142
135
|
"module": "dist/index.js",
|
|
@@ -150,10 +143,10 @@
|
|
|
150
143
|
"compile": "npx vite build && npm run types",
|
|
151
144
|
"clean": "rm -rf ./dist && rm -rf ./types && rm -f ./tsconfig.tsbuildinfo",
|
|
152
145
|
"test": "npx vitest --coverage",
|
|
153
|
-
"types": "npx tsc && npx dts-bundle-generator --config ./dts.config.
|
|
146
|
+
"types": "npx tsc && npx dts-bundle-generator --config ./dts.config.cts --silent",
|
|
154
147
|
"watch": "npx vite build --watch"
|
|
155
148
|
},
|
|
156
149
|
"type": "module",
|
|
157
150
|
"types": "types/index.d.cts",
|
|
158
|
-
"version": "0.
|
|
151
|
+
"version": "0.17.0"
|
|
159
152
|
}
|
package/src/attribute.ts
CHANGED
package/src/sanitise.ts
CHANGED
|
@@ -56,7 +56,9 @@ function sanitiseNodes(nodes: Node[], options: SanitiseOptions): Node[] {
|
|
|
56
56
|
sanitiseAttributes(node, [...node.attributes], options);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
if (node.hasChildNodes()) {
|
|
60
|
+
sanitiseNodes([...node.childNodes], options);
|
|
61
|
+
}
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
return nodes;
|