vaderjs 1.3.3-612-hotfix → 1.3.3-6124766be812

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 +23 -24
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-612-hotfix",
5
+ "version": "1.3.3-6124766be812",
6
6
  "bin": {
7
7
  "vader": "./vader.js"
8
8
  },
package/vader.js CHANGED
@@ -533,10 +533,11 @@ function Compiler(func, file) {
533
533
  else if (prop.includes('${')) {
534
534
 
535
535
 
536
- prop = prop.replace('="', ':')
536
+ prop = prop.replace('="', ':').replace('}"', '}')
537
537
  if (prop.includes('${')) {
538
538
  prop = prop.replace('="', ':')
539
- prop = prop.replace('${', '')
539
+ prop = prop.replace('${', '')
540
+
540
541
  }
541
542
  if (prop.includes('="${{')) {
542
543
  prop = prop.replace('${{', '{')
@@ -546,21 +547,19 @@ function Compiler(func, file) {
546
547
  }
547
548
 
548
549
  }
549
- if (prop.includes('={')) {
550
- let value = prop.split('={')
551
- let isObj = value[1].match(/^{.*}$/gs) ? true : false
552
- if (!isObj) {
553
- // remove trailing }
554
- value[1] = value[1].replace(/}\s*$/, '')
555
- }
556
-
557
- if(value[0] == 'style' && isObj){
558
- value[1] = `this.parseStyle(${value[1]})`
559
- }
560
- prop = `${value[0]}:${value[1]}`
550
+ else if (prop.includes('={')) {
551
+ let key = prop.split('=')[0].trim()
552
+ let value = prop.split('=')[1].trim()
553
+ if(value.startsWith('{')){
554
+ value = value.replace('{', '')
555
+ }
556
+ if(value.endsWith('}')){
557
+ value = value.slice(0, -1)
558
+ }
559
+ prop = `${key}:${value}`
561
560
  }
562
561
 
563
- if (prop.includes('function') || prop.includes('=>')){
562
+ if (prop.includes('function')) {
564
563
  // parse 'function' to function
565
564
  prop = prop.replace("'", '')
566
565
 
@@ -569,9 +568,9 @@ function Compiler(func, file) {
569
568
 
570
569
  }
571
570
 
572
- prop = prop.replace('=function', ':function')
571
+ prop = prop.replace('=function', ':function')
573
572
  }
574
-
573
+
575
574
  filteredProps.push(prop);
576
575
 
577
576
 
@@ -598,7 +597,7 @@ function Compiler(func, file) {
598
597
 
599
598
  let savedname = name;
600
599
 
601
-
600
+
602
601
 
603
602
  name = name + Math.random().toString(36).substring(2);
604
603
  if (children && children.match(componentRegex)) {
@@ -951,8 +950,8 @@ async function Build() {
951
950
  res.render(module, req, res, module.$metadata)
952
951
  }
953
952
  catch(error){
954
- document.documentElement.setAttribute('error', JSON.stringify({stack: error.stack, message: error.message, at: '${route.fileName}', line: error.lineNumber}))
955
- throw new Error({stack: error.stack, message: error.message})
953
+ document.documentElement.setAttribute('error', error.message)
954
+ throw new Error(error.message)
956
955
  }
957
956
  })
958
957
  ${equalparamroute.length > 0 ? equalparamroute.map((e) => {
@@ -1014,7 +1013,7 @@ async function Build() {
1014
1013
  globalThis.listen = true;
1015
1014
 
1016
1015
  const browser = await puppeteer.launch({
1017
- headless: "new", args: ['--no-sandbox', '--disable-setuid-sandbox'],
1016
+ headless: "new", args: ['--no-sandbox', '--disable-setuid-sandbox'],
1018
1017
  warning: false,
1019
1018
  })
1020
1019
  try {
@@ -1034,10 +1033,10 @@ async function Build() {
1034
1033
  page.on('pageerror', async err => {
1035
1034
  let errorObj = await page.evaluate(() => document.documentElement.getAttribute('error'))
1036
1035
  console.log('\x1b[31m%s\x1b[0m', 'PAGE ERROR:', errorObj);
1037
-
1036
+ throw new Error(errorObj)
1038
1037
  });
1039
1038
  } catch (error) {
1040
- browser.close()
1039
+ // do nothing
1041
1040
  }
1042
1041
  // Handle page crashes
1043
1042
  page.on('crash', () => {
@@ -1075,7 +1074,7 @@ async function Build() {
1075
1074
  }
1076
1075
 
1077
1076
  finally {
1078
- browser.close()
1077
+ await browser.close();
1079
1078
  server.close()
1080
1079
  }
1081
1080
  })