@aloma.io/integration-sdk 3.8.60 → 3.8.61
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/build/transform/index.mjs +10 -3
- package/package.json +1 -1
- package/src/transform/index.mts +11 -3
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { parseFromFiles } from '@ts-ast-parser/core';
|
|
2
|
+
function stripQuotes(name) {
|
|
3
|
+
if ((name.startsWith("'") && name.endsWith("'")) || (name.startsWith('"') && name.endsWith('"'))) {
|
|
4
|
+
return name.slice(1, -1);
|
|
5
|
+
}
|
|
6
|
+
return name;
|
|
7
|
+
}
|
|
2
8
|
const transform = (meta) => {
|
|
3
9
|
if (!meta?.length)
|
|
4
10
|
throw new Error('metadata is empty');
|
|
@@ -13,11 +19,12 @@ const transform = (meta) => {
|
|
|
13
19
|
member.isInherited() ||
|
|
14
20
|
member.getKind() !== 'Method' ||
|
|
15
21
|
member.getModifier() !== 'public' ||
|
|
16
|
-
member.getName().startsWith('_'));
|
|
22
|
+
stripQuotes(member.getName()).startsWith('_'));
|
|
17
23
|
});
|
|
18
24
|
const text = members
|
|
19
25
|
.map((member) => {
|
|
20
|
-
|
|
26
|
+
const methodName = stripQuotes(member.getName());
|
|
27
|
+
methods[methodName] = true;
|
|
21
28
|
return member
|
|
22
29
|
.getSignatures()
|
|
23
30
|
.map((sig) => {
|
|
@@ -66,7 +73,7 @@ const transform = (meta) => {
|
|
|
66
73
|
* ${space || ''}
|
|
67
74
|
* ${eg || ''}
|
|
68
75
|
**/
|
|
69
|
-
declare function ${
|
|
76
|
+
declare function ${methodName}(${params}): ${retVal};
|
|
70
77
|
`;
|
|
71
78
|
})
|
|
72
79
|
.join('\n');
|
package/package.json
CHANGED
package/src/transform/index.mts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import {parseFromFiles} from '@ts-ast-parser/core';
|
|
2
2
|
|
|
3
|
+
function stripQuotes(name: string): string {
|
|
4
|
+
if ((name.startsWith("'") && name.endsWith("'")) || (name.startsWith('"') && name.endsWith('"'))) {
|
|
5
|
+
return name.slice(1, -1);
|
|
6
|
+
}
|
|
7
|
+
return name;
|
|
8
|
+
}
|
|
9
|
+
|
|
3
10
|
const transform = (meta: any) => {
|
|
4
11
|
if (!meta?.length) throw new Error('metadata is empty');
|
|
5
12
|
meta = meta[0];
|
|
@@ -17,13 +24,14 @@ const transform = (meta: any) => {
|
|
|
17
24
|
member.isInherited() ||
|
|
18
25
|
member.getKind() !== 'Method' ||
|
|
19
26
|
member.getModifier() !== 'public' ||
|
|
20
|
-
member.getName().startsWith('_')
|
|
27
|
+
stripQuotes(member.getName()).startsWith('_')
|
|
21
28
|
);
|
|
22
29
|
});
|
|
23
30
|
|
|
24
31
|
const text = members
|
|
25
32
|
.map((member: any) => {
|
|
26
|
-
|
|
33
|
+
const methodName = stripQuotes(member.getName());
|
|
34
|
+
methods[methodName] = true;
|
|
27
35
|
|
|
28
36
|
return member
|
|
29
37
|
.getSignatures()
|
|
@@ -85,7 +93,7 @@ const transform = (meta: any) => {
|
|
|
85
93
|
* ${space || ''}
|
|
86
94
|
* ${eg || ''}
|
|
87
95
|
**/
|
|
88
|
-
declare function ${
|
|
96
|
+
declare function ${methodName}(${params}): ${retVal};
|
|
89
97
|
`;
|
|
90
98
|
})
|
|
91
99
|
.join('\n');
|