vaderjs 1.3.3-alpha-16 → 1.3.3-alpha-17

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 -3
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-alpha-16",
5
+ "version": "1.3.3-alpha-17",
6
6
  "bin": {
7
7
  "vader": "./vader.js"
8
8
  },
package/vader.js CHANGED
@@ -134,11 +134,12 @@ function Compiler(func) {
134
134
  if (functionNames.length > 0) {
135
135
  functionNames.forEach((name) => {
136
136
  string.split("\n").forEach((line) => {
137
- if (line.includes(name) && line.includes("function")) {
137
+ if (line.includes(name) && line.includes("function") || line.includes(name) && line.includes("=>")) {
138
138
  line = line.trim();
139
139
  line = line.replace(/\s+/g, " ");
140
140
 
141
- let ps = line.split("(").slice(1).join("(").split(")")[0].trim();
141
+ let ps = line.split("(")[1].split(")")[0].trim();
142
+
142
143
 
143
144
  // remove comments
144
145
  ps = ps.match(/\/\*.*\*\//gs)
@@ -159,6 +160,7 @@ function Compiler(func) {
159
160
  let params = hasParams
160
161
  ? line.split("(")[1].split(")")[0].trim()
161
162
  : null;
163
+
162
164
 
163
165
  if (
164
166
  functionparams.length > 0 &&
@@ -185,8 +187,9 @@ function Compiler(func) {
185
187
  } ${params || null}${isJSXComponent ? "" : ","} true ${isJSXComponent ? "" : ","
186
188
  } '${ref}')`;
187
189
 
190
+ console.log(replacement)
188
191
  newvalue = newvalue.replace(
189
- hasParams ? `${name}(${params})` : name,
192
+ line,
190
193
  `this.callFunction(\${${replacement}}, ${isJSXComponent ? true : false
191
194
  }, event,${params || null})`
192
195
  );