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.
- package/package.json +1 -1
- package/vader.js +6 -16
package/package.json
CHANGED
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
112
|
+
|
|
124
113
|
|
|
125
|
-
|
|
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
|
|