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.
- package/package.json +1 -1
- package/vader.js +6 -3
package/package.json
CHANGED
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 =
|
|
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
|
-
|
|
192
|
+
line,
|
|
190
193
|
`this.callFunction(\${${replacement}}, ${isJSXComponent ? true : false
|
|
191
194
|
}, event,${params || null})`
|
|
192
195
|
);
|