vaderjs 1.3.3-7722242 → 1.3.3-7725242-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 -16
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-7722242",
5
+ "version": "1.3.3-7725242-hotfix",
6
6
  "bin": {
7
7
  "vader": "./vader.js"
8
8
  },
package/vader.js CHANGED
@@ -479,7 +479,7 @@ function Compiler(func, file) {
479
479
 
480
480
  let name = component.split("<")[1].split(">")[0].split(" ")[0].replace("/", "");
481
481
  let componentAttributes = component.split("<")[1].split(">")[0].split(" ").join(" ").replace(name, "").trim();
482
- const dynamicAttributesRegex = /(\w+)(?:="([^"]*?)"|='([^']*?)'|(?:=\{([^}]*?)\})?|(?:=\{(.*?)*\})?|(?:={([^}]*?)})?|(?:{([^}]*?)})?|(?:}))?|\$=\s*\{\s*\{\s*([^]*?)\s*\}\s*\}/gs;
482
+ const dynamicAttributesRegex = /(\w+)(?:="([^"]*?)"|='([^']*?)'|(?:=\{([^}]*?)\})?|(?:=\{(.*?)*\})?|(?:={([^}]*?)})?|(?:{([^}]*?)})?|(?:}))?|={\s*.*?\s*}/gs;
483
483
 
484
484
 
485
485
 
@@ -499,16 +499,8 @@ function Compiler(func, file) {
499
499
  isWithinComponent = true;
500
500
  filteredProps.push(prop);
501
501
  } else if (isWithinComponent && prop.includes('=')) {
502
-
503
- if (prop.startsWith('$=')) {
504
- let old = prop
505
- prop = prop.replace(/\$\s*=\s*\{\s*\{\s*([^]*?)\s*\}\s*\}/gs, '$1')
506
- component = component.replace(old, '')
507
- componentAttributes = componentAttributes.replace(prop, '')
508
- $_ternaryprops.push(prop)
509
-
510
- }
511
- else if (prop.includes('${')) {
502
+
503
+ if (prop.includes('${')) {
512
504
 
513
505
 
514
506
  prop = prop.replace('="', ':')
@@ -527,14 +519,16 @@ function Compiler(func, file) {
527
519
  if (prop.includes('={')) {
528
520
  let value = prop.split('={')
529
521
  let isObj = value[1].match(/^{.*}$/gs) ? true : false
530
- if (!isObj) {
531
- // remove trailing }
522
+ if (!isObj) {
532
523
  value[1] = value[1].replace(/}\s*$/, '')
524
+ }else if(!value[0].length > 0 && isObj){
525
+ value[0] = '$'
533
526
  }
527
+
534
528
 
535
529
  if (value[0] == 'style' && isObj) {
536
530
  value[1] = `this.parseStyle(${value[1]})`
537
- }
531
+ }
538
532
  prop = `${value[0]}:${value[1]}`
539
533
  }
540
534
 
@@ -1231,7 +1225,7 @@ async function Build() {
1231
1225
  await writer(process.cwd() + "/dist/src/" + name, data);
1232
1226
  })
1233
1227
 
1234
- const scannedPublicFiles = await glob("**/**.{css,js,html,mjs,cjs}", {
1228
+ const scannedPublicFiles = await glob("**/**/**.{css,js,html,mjs,cjs,png,jpg,jpeg,gif,svg,mp4,webm,ogg}", {
1235
1229
  ignore: ["node_modules/**/*", "dist/**/*"],
1236
1230
  cwd: process.cwd() + '/public/',
1237
1231
  absolute: true,
@@ -1239,7 +1233,7 @@ async function Build() {
1239
1233
  scannedPublicFiles.forEach(async (file) => {
1240
1234
  file = file.replace(/\\/g, '/');
1241
1235
  file = file.split('/public/')[1]
1242
- let data = await reader(process.cwd() + "/public/" + file)
1236
+ let data = fs.readFileSync(process.cwd() + "/public/" + file);
1243
1237
  bundleSize += fs.statSync(process.cwd() + "/public/" + file).size;
1244
1238
  await writer(process.cwd() + "/dist/public/" + file, data);
1245
1239
  })