vaderjs 1.9.0 → 1.9.1

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.
Files changed (2) hide show
  1. package/index.ts +9 -5
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -185,8 +185,8 @@ interface SwitchProps {
185
185
  // make children optional
186
186
  export function Switch({ children = [] }: SwitchProps) {
187
187
  for (let child of children) {
188
- if (child && child.props && child.props.when) {
189
- return child;
188
+ if (child.props.when) {
189
+ return child
190
190
  }
191
191
  }
192
192
  return { type: "div", props: {}, children: [] };
@@ -620,9 +620,13 @@ export class Component {
620
620
  const handler = attributes[key];
621
621
  this.eventRegistry.set(el, [...(this.eventRegistry.get(el) || []), { event: eventType, handler }]);
622
622
  this.addEventListener(el, eventType, handler);
623
- } else if (attributes[key] !== null && attributes[key] !== undefined) {
624
- // General attributes
625
- el.setAttribute(key, attributes[key]);
623
+ } else if (attributes[key] !== null && attributes[key] !== undefined &&
624
+ !key.includes(" ") || !key.includes("-") || !key.includes("_")) {
625
+ try {
626
+ el.setAttribute(key, attributes[key]);
627
+ } catch (error) {
628
+
629
+ }
626
630
  }
627
631
  }
628
632
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vaderjs",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "A simple and powerful JavaScript library for building modern web applications.",
5
5
  "bin": {
6
6
  "vaderjs": "./main.js"