vaderjs 1.3.3-7924566dd811 → 1.3.3-8924566yt812

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 +6 -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-7924566dd811",
5
+ "version": "1.3.3-8924566yt812",
6
6
  "bin": {
7
7
  "vader": "./vader.js"
8
8
  },
package/vader.js CHANGED
@@ -47,18 +47,7 @@ function Compiler(func, file) {
47
47
 
48
48
 
49
49
 
50
-
51
- // get all Obj({}) and parse to JSON.stringify
52
-
53
- let objects = string.match(/Obj\({.*}\)/gs);
54
-
55
- objects && objects.forEach((obj) => {
56
- let key = obj.split("Obj")[1].split("(")[1].split(")")[0].trim();
57
- let newobj = obj.replaceAll(`Obj(${key})`, `${key}`);
58
- // let newobj = obj.replaceAll(`Obj(${key})`, `JSON.parse('${key}')`)
59
- string = string.replaceAll(obj, `this.handleObject('${newobj}')`);
60
- });
61
-
50
+
62
51
 
63
52
  let childs = [];
64
53
 
@@ -96,6 +85,8 @@ function Compiler(func, file) {
96
85
  e = e.replace(/:(.*)/gs, '={$1.join(" ")}')
97
86
  break;
98
87
  default:
88
+ e = e.replace(/:(.*)/gs, '=$1')
89
+ break;
99
90
  }
100
91
 
101
92
  return e.trim()
@@ -118,11 +109,9 @@ function Compiler(func, file) {
118
109
  const attributeRegex =
119
110
  /\s*([a-zA-Z0-9_-]+)(\s*=\s*("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|\{(?:[^{}]|(?:\{(?:[^{}]|(?:\{[^{}]*\})*)*\})*)*\}|(?:\([^)]*\)|\{[^}]*\}|()=>\s*(?:\{[^}]*\})?)|\[[^\]]*\]))?/gs;
120
111
 
121
- // <div $={{color: 'red'}}></div>
122
-
123
-
112
+
124
113
 
125
- // only return elements with attribute {()=>{}} or if it also has parameters ex: onclick={(event)=>{console.log(event)}} also get muti line functions or onClick=()=>{}
114
+
126
115
  const functionAttributeRegex = /\s*([a-zA-Z0-9_-]+)(\s*=\s*{((?:[^{}]|(?:\{(?:[^{}]|(?:\{[^{}]*\})*)*\})*)*)})/gs;
127
116
 
128
117
  let attributesList = [];
@@ -1074,6 +1063,7 @@ async function Build() {
1074
1063
 
1075
1064
 
1076
1065
  let data = await fs.readFileSync(origin, "utf8");
1066
+ console.log(`Compiling ${fileName}...`)
1077
1067
  data = Compiler(data, origin);
1078
1068
 
1079
1069