svelte-reflector 1.0.25 → 1.0.26
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/dist/helpers/helpers.js +12 -6
- package/dist/method.js +3 -3
- package/package.json +1 -1
package/dist/helpers/helpers.js
CHANGED
|
@@ -91,13 +91,19 @@ export function getEndpoint(rawEndpoint) {
|
|
|
91
91
|
return filteredEntitys.join("/");
|
|
92
92
|
}
|
|
93
93
|
export function getFullEndpoint(rawEndpoint) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
.filter(
|
|
94
|
+
return rawEndpoint
|
|
95
|
+
.split("/")
|
|
96
|
+
.filter(Boolean)
|
|
97
97
|
.map((str) => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
// pega somente params no formato "{algumaCoisa}"
|
|
99
|
+
const match = new RegExp(/^\{(.+)\}$/).exec(str);
|
|
100
|
+
if (match) {
|
|
101
|
+
const key = match[1]; // sem { }
|
|
102
|
+
return `\${paths.${key}}`; // gera "${paths.key}" como texto
|
|
103
|
+
}
|
|
104
|
+
return str;
|
|
105
|
+
})
|
|
106
|
+
.join("/");
|
|
101
107
|
}
|
|
102
108
|
export function treatenEnum(enums) {
|
|
103
109
|
const a = enums.map((e) => `"${e}"`);
|
package/dist/method.js
CHANGED
|
@@ -55,9 +55,9 @@ export class Method {
|
|
|
55
55
|
const paths = this.gee(this.paths);
|
|
56
56
|
const cookies = this.gee(this.cookies);
|
|
57
57
|
return `
|
|
58
|
-
${querys.length > 0 ? `const
|
|
59
|
-
${paths.length > 0 ? `const
|
|
60
|
-
${cookies.length > 0 ? `const
|
|
58
|
+
${querys.length > 0 ? `const querys = this.querys.bundle()` : ""};
|
|
59
|
+
${paths.length > 0 ? `const paths = this.paths.bundle()` : ""};
|
|
60
|
+
${cookies.length > 0 ? `const cookies = this.cookies.bundle()` : ""};
|
|
61
61
|
`;
|
|
62
62
|
}
|
|
63
63
|
buildCallMethod() {
|