@server/next 0.28.2 → 0.28.3

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": "@server/next",
3
- "version": "0.28.2",
3
+ "version": "0.28.3",
4
4
  "description": "A fully-fledged web server with routing, file uploads, sessions, static files, schema validation, websockets, testing, etc.",
5
5
  "homepage": "https://server-js.com/",
6
6
  "repository": "https://github.com/franciscop/server-next.git",
@@ -118,11 +118,13 @@ const jsx = (tag, { children, ...props }) => {
118
118
  .filter(([k]) => k !== "dangerouslySetInnerHTML")
119
119
  .filter(([k, v]) => !/on[A-Z]/.test(k) && typeof v !== "function")
120
120
  .filter(([, v]) => v !== false)
121
- .map(([k, v]) =>
122
- v === true
123
- ? altAttrs[k.toLowerCase()] || encode(k)
124
- : `${altAttrs[k.toLowerCase()] || encode(k)}="${encode(String(v))}"`,
125
- )
121
+ .map(([k, v]) => {
122
+ const key = altAttrs[k.toLowerCase()] || encode(k);
123
+ if (v === true) return key;
124
+ const value =
125
+ typeof v === "string" || typeof v === "number" ? encode(v) : "";
126
+ return `${key}="${value}"`;
127
+ })
126
128
  .join(" ");
127
129
 
128
130
  if (attrStr) attrStr = ` ${attrStr}`;