@thi.ng/hiccup 5.3.32 → 5.3.34
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/README.md +1 -1
- package/attribs.js +1 -1
- package/css.js +1 -1
- package/deref.js +1 -1
- package/package.json +7 -7
- package/serialize.js +3 -3
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 212 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/attribs.js
CHANGED
|
@@ -8,7 +8,7 @@ const mergeClasses = (existing, val) => {
|
|
|
8
8
|
if (isArray(val)) val = val.join(" ");
|
|
9
9
|
if (isString(val)) return $existing ? $existing + " " + val : val;
|
|
10
10
|
const classes = new Set($existing ? $existing.split(" ") : void 0);
|
|
11
|
-
for (
|
|
11
|
+
for (const id in val) {
|
|
12
12
|
deref(val[id]) ? classes.add(id) : classes.delete(id);
|
|
13
13
|
}
|
|
14
14
|
return [...classes].join(" ");
|
package/css.js
CHANGED
package/deref.js
CHANGED
|
@@ -2,7 +2,7 @@ import { implementsFunction } from "@thi.ng/checks/implements-function";
|
|
|
2
2
|
const derefContext = (ctx, keys) => {
|
|
3
3
|
if (ctx == null || !keys || !keys.length) return ctx;
|
|
4
4
|
const res = { ...ctx };
|
|
5
|
-
for (
|
|
5
|
+
for (const k of keys) {
|
|
6
6
|
const v = res[k];
|
|
7
7
|
if (implementsFunction(v, "deref")) res[k] = v.deref();
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/hiccup",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.34",
|
|
4
4
|
"description": "HTML/SVG/XML serialization of nested data structures, iterables & closures",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.12.
|
|
43
|
-
"@thi.ng/checks": "^3.
|
|
44
|
-
"@thi.ng/errors": "^2.
|
|
45
|
-
"@thi.ng/strings": "^3.9.
|
|
42
|
+
"@thi.ng/api": "^8.12.11",
|
|
43
|
+
"@thi.ng/checks": "^3.8.1",
|
|
44
|
+
"@thi.ng/errors": "^2.6.0",
|
|
45
|
+
"@thi.ng/strings": "^3.9.32"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@thi.ng/atom": "^5.3.
|
|
48
|
+
"@thi.ng/atom": "^5.3.52",
|
|
49
49
|
"esbuild": "^0.27.0",
|
|
50
50
|
"typedoc": "^0.28.14",
|
|
51
51
|
"typescript": "^5.9.3"
|
|
@@ -130,5 +130,5 @@
|
|
|
130
130
|
],
|
|
131
131
|
"year": 2016
|
|
132
132
|
},
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "e7a21b9d2a188fa04d4c893d8531c40fbc0f4c06\n"
|
|
134
134
|
}
|
package/serialize.js
CHANGED
|
@@ -53,7 +53,7 @@ const __serializeTag = (tree, opts, path) => {
|
|
|
53
53
|
};
|
|
54
54
|
const __serializeAttribs = (attribs, opts) => {
|
|
55
55
|
let res = "";
|
|
56
|
-
for (
|
|
56
|
+
for (const a in attribs) {
|
|
57
57
|
if (a.startsWith("__")) continue;
|
|
58
58
|
const v = __serializeAttrib(attribs, a, deref(attribs[a]), opts);
|
|
59
59
|
v != null && (res += v);
|
|
@@ -69,7 +69,7 @@ const __attribPair = (a, v, opts) => {
|
|
|
69
69
|
};
|
|
70
70
|
const __serializeDataAttribs = (data, opts) => {
|
|
71
71
|
let res = "";
|
|
72
|
-
for (
|
|
72
|
+
for (const id in data) {
|
|
73
73
|
let v = deref(data[id]);
|
|
74
74
|
isFunction(v) && (v = v(data));
|
|
75
75
|
v != null && (res += ` data-${id}="${__escape(v, opts)}"`);
|
|
@@ -103,7 +103,7 @@ const __serializeIter = (iter, opts, path) => {
|
|
|
103
103
|
const res = [];
|
|
104
104
|
const p = path.slice(0, path.length - 1);
|
|
105
105
|
let k = 0;
|
|
106
|
-
for (
|
|
106
|
+
for (const i of iter) {
|
|
107
107
|
res.push(__serialize(i, opts, [...p, k++]));
|
|
108
108
|
}
|
|
109
109
|
return res.join("");
|