vaderjs 1.3.3-7725242-hotfix → 1.3.3-7725642-hotfix

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/package.json +1 -1
  2. package/vader.js +10 -6
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "vaderjs",
3
3
  "description": "A Reactive library aimed to helping you build reactive applications inspired by react.js",
4
4
  "module": "vader.js",
5
- "version": "1.3.3-7725242-hotfix",
5
+ "version": "1.3.3-7725642-hotfix",
6
6
  "bin": {
7
7
  "vader": "./vader.js"
8
8
  },
package/vader.js CHANGED
@@ -143,6 +143,9 @@ function Compiler(func, file) {
143
143
  isJSXComponent = elementTag.match(/^[A-Z]/) ? true : false;
144
144
  }
145
145
  });
146
+ if(isJSXComponent){
147
+ continue
148
+ }
146
149
  // add ; after newlines
147
150
 
148
151
 
@@ -479,9 +482,8 @@ function Compiler(func, file) {
479
482
 
480
483
  let name = component.split("<")[1].split(">")[0].split(" ")[0].replace("/", "");
481
484
  let componentAttributes = component.split("<")[1].split(">")[0].split(" ").join(" ").replace(name, "").trim();
482
- const dynamicAttributesRegex = /(\w+)(?:="([^"]*?)"|='([^']*?)'|(?:=\{([^}]*?)\})?|(?:=\{(.*?)*\})?|(?:={([^}]*?)})?|(?:{([^}]*?)})?|(?:}))?|={\s*.*?\s*}/gs;
483
-
484
-
485
+ // catchall = {...}
486
+ const dynamicAttributesRegex = /(\w+)(?:="([^"]*?)"|='([^']*?)'|(?:=\{(.*?)\})?|(?:=\{(.*?)\})?)(?:\}|(?=\s[\w-]+=))/gs;
485
487
 
486
488
  let props = component.match(dynamicAttributesRegex)
487
489
 
@@ -492,6 +494,7 @@ function Compiler(func, file) {
492
494
 
493
495
  let $_ternaryprops = []
494
496
 
497
+ if(props){
495
498
  for (let prop of props) {
496
499
 
497
500
  if (prop === componentName) {
@@ -522,10 +525,10 @@ function Compiler(func, file) {
522
525
  if (!isObj) {
523
526
  value[1] = value[1].replace(/}\s*$/, '')
524
527
  }else if(!value[0].length > 0 && isObj){
525
- value[0] = '$'
528
+ prop = ''
526
529
  }
527
-
528
-
530
+
531
+ value[1] = value[1].replace(/}\s*$/, '')
529
532
  if (value[0] == 'style' && isObj) {
530
533
  value[1] = `this.parseStyle(${value[1]})`
531
534
  }
@@ -557,6 +560,7 @@ function Compiler(func, file) {
557
560
  isWithinComponent = false;
558
561
  }
559
562
  }
563
+ }
560
564
  component = component.replaceAll(/\s+/g, " ");
561
565
 
562
566
  component = component.replace(componentAttributes, '')