@miaskiewicz/turbo-dom 0.1.27 → 0.1.28
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miaskiewicz/turbo-dom",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28",
|
|
4
4
|
"description": "Faster, more spec-correct DOM for test runners — native html5ever (Rust/WASM) parser + lazy copy-on-write DOM. A drop-in-style alternative to jsdom/happy-dom for vitest & jest.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -20,7 +20,10 @@ function serializeNode(node, out) {
|
|
|
20
20
|
case 1: { // element
|
|
21
21
|
const tag = node.localName;
|
|
22
22
|
out.push('<' + tag);
|
|
23
|
-
|
|
23
|
+
// __attrs is lazy: buffer-backed elements leave it undefined (store __attrIdx).
|
|
24
|
+
// Build from the SoA on first touch, matching every other __attrs read site.
|
|
25
|
+
const attrs = node.__attrs ?? (node.__attrs = node.__buildAttrs());
|
|
26
|
+
for (const a of attrs) {
|
|
24
27
|
const name = a.prefix ? `${a.prefix}:${a.name}` : a.name;
|
|
25
28
|
out.push(` ${name}="${escapeAttr(a.value)}"`);
|
|
26
29
|
}
|
|
Binary file
|