vaderjs 1.9.5 → 1.9.6

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 +13 -8
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -37,13 +37,15 @@ declare global {
37
37
  //@ts-ignore
38
38
  globalThis.isServer = typeof window === "undefined";
39
39
  //@ts-ignore
40
- globalThis.params = {
41
- [Symbol.iterator]: function* () {
42
- for (const key in this) {
43
- yield [key, this[key]];
44
- }
45
- },
46
- };
40
+ if(isServer){
41
+ globalThis.params = {
42
+ [Symbol.iterator]: function* () {
43
+ for (const key in this) {
44
+ yield [key, this[key]];
45
+ }
46
+ },
47
+ };
48
+ }
47
49
 
48
50
 
49
51
 
@@ -153,9 +155,12 @@ export const e = (element, props, ...children) => {
153
155
  firstEl = { type: "div", props: { key: instance.key, ...props }, children };
154
156
  firstEl.props = { key: instance.key, ...firstEl.props, ...props };
155
157
  firstEl.props["idKey"] = instance.key;
156
- instance.props = firstEl.props;
158
+ instance.props = firstEl.props;
157
159
  return firstEl;
158
160
  default:
161
+ if(!element) {
162
+ return "";
163
+ }
159
164
  let el = { type: element, props: props || {}, children: children || [] };
160
165
  if (el.type !== "head") {
161
166
  el.props = { idKey: crypto.randomUUID(), ...el.props };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vaderjs",
3
- "version": "1.9.5",
3
+ "version": "1.9.6",
4
4
  "description": "A simple and powerful JavaScript library for building modern web applications.",
5
5
  "bin": {
6
6
  "vaderjs": "./main.js"