@thi.ng/hiccup
Advanced tools
Comparing version 5.2.0 to 5.2.1
@@ -6,8 +6,5 @@ import { deref } from "@thi.ng/api/deref"; | ||
val = deref(val); | ||
if (val == null) | ||
return existing; | ||
if (isArray(val)) | ||
val = val.join(" "); | ||
if (isString(val)) | ||
return existing ? existing + " " + val : val; | ||
if (val == null) return existing; | ||
if (isArray(val)) val = val.join(" "); | ||
if (isString(val)) return existing ? existing + " " + val : val; | ||
const classes = new Set(existing ? existing.split(" ") : void 0); | ||
@@ -14,0 +11,0 @@ for (let id in val) { |
# Change Log | ||
- **Last updated**: 2024-04-25T19:44:55Z | ||
- **Last updated**: 2024-05-08T18:24:32Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -5,0 +5,0 @@ |
@@ -8,6 +8,4 @@ import { deref } from "@thi.ng/api/deref"; | ||
v = deref(rules[r]); | ||
if (isFunction(v)) | ||
v = v(rules); | ||
if (v != null) | ||
css2 += `${r}:${v};`; | ||
if (isFunction(v)) v = v(rules); | ||
if (v != null) css2 += `${r}:${v};`; | ||
} | ||
@@ -14,0 +12,0 @@ return css2; |
import { implementsFunction } from "@thi.ng/checks/implements-function"; | ||
const derefContext = (ctx, keys) => { | ||
if (ctx == null || !keys || !keys.length) | ||
return ctx; | ||
if (ctx == null || !keys || !keys.length) return ctx; | ||
const res = { ...ctx }; | ||
for (let k of keys) { | ||
const v = res[k]; | ||
if (implementsFunction(v, "deref")) | ||
res[k] = v.deref(); | ||
if (implementsFunction(v, "deref")) res[k] = v.deref(); | ||
} | ||
@@ -11,0 +9,0 @@ return res; |
{ | ||
"name": "@thi.ng/hiccup", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"description": "HTML/SVG/XML serialization of nested data structures, iterables & closures", | ||
@@ -39,13 +39,13 @@ "type": "module", | ||
"dependencies": { | ||
"@thi.ng/api": "^8.11.1", | ||
"@thi.ng/checks": "^3.6.3", | ||
"@thi.ng/errors": "^2.5.6", | ||
"@thi.ng/strings": "^3.7.32" | ||
"@thi.ng/api": "^8.11.2", | ||
"@thi.ng/checks": "^3.6.4", | ||
"@thi.ng/errors": "^2.5.7", | ||
"@thi.ng/strings": "^3.7.33" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.43.0", | ||
"@thi.ng/atom": "^5.2.45", | ||
"esbuild": "^0.20.2", | ||
"typedoc": "^0.25.12", | ||
"typescript": "^5.4.3" | ||
"@microsoft/api-extractor": "^7.43.2", | ||
"@thi.ng/atom": "^5.3.0", | ||
"esbuild": "^0.21.1", | ||
"typedoc": "^0.25.13", | ||
"typescript": "^5.4.5" | ||
}, | ||
@@ -132,3 +132,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "aed3421c21044c005fbcb7cc37965ccf85a870d2\n" | ||
"gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n" | ||
} |
@@ -31,4 +31,3 @@ import { deref, isDeref } from "@thi.ng/api/deref"; | ||
}; | ||
if (opts?.keys == null && $opts.span) | ||
$opts.keys = true; | ||
if (opts?.keys == null && $opts.span) $opts.keys = true; | ||
return _serialize(tree, $opts, path); | ||
@@ -48,4 +47,3 @@ }; | ||
const attribs = tree[1]; | ||
if (attribs.__skip || attribs.__serialize === false) | ||
return ""; | ||
if (attribs.__skip || attribs.__serialize === false) return ""; | ||
opts.keys && attribs.key === void 0 && (attribs.key = path.join("-")); | ||
@@ -59,4 +57,3 @@ const tag = tree[0]; | ||
for (let a in attribs) { | ||
if (a.startsWith("__")) | ||
continue; | ||
if (a.startsWith("__")) continue; | ||
const v = serializeAttrib(attribs, a, deref(attribs[a]), opts); | ||
@@ -89,4 +86,3 @@ v != null && (res += v); | ||
let res = proc ? " " : ">"; | ||
if (opts.span && !proc && !NO_SPANS[tag]) | ||
opts = { ...opts, span: true }; | ||
if (opts.span && !proc && !NO_SPANS[tag]) opts = { ...opts, span: true }; | ||
for (let i = 0, n = body.length; i < n; i++) { | ||
@@ -93,0 +89,0 @@ res += _serialize(body[i], opts, [...path, i]); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77118
561
Updated@thi.ng/api@^8.11.2
Updated@thi.ng/checks@^3.6.4
Updated@thi.ng/errors@^2.5.7
Updated@thi.ng/strings@^3.7.33