datagrok-tools 4.14.23 → 4.14.24
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/bin/commands/api.js +1 -7
- package/bin/utils/utils.js +2 -2
- package/package.json +1 -1
package/bin/commands/api.js
CHANGED
|
@@ -103,13 +103,7 @@ function generateFunctionWrappers() {
|
|
|
103
103
|
const annotationInputs = utils.getScriptInputs(annotation[0], utils.commentMap[utils.jsExtention]);
|
|
104
104
|
const annotationOutputDir = utils.getScriptOutputType(annotation[0], utils.commentMap[utils.jsExtention]);
|
|
105
105
|
let outputType = '';
|
|
106
|
-
|
|
107
|
-
if (outputType != '') {
|
|
108
|
-
outputType = 'any';
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
outputType = utils.dgToTsTypeMap[outputAnnotation[1]] ?? 'any';
|
|
112
|
-
}
|
|
106
|
+
outputType = annotationOutputDir ?? 'any';
|
|
113
107
|
checkNameColision(name);
|
|
114
108
|
const tb = new utils.TemplateBuilder(utils.scriptWrapperTemplate).replace('FUNC_NAME', name).replace('FUNC_NAME_LOWERCASE', name).replace('PACKAGE_NAMESPACE', _package?.friendlyName ?? '').replace('PARAMS_OBJECT', annotationInputs).replace('FUNC_DESCRIPTION', description).replace('TYPED_PARAMS', annotationInputs).replace('OUTPUT_TYPE', outputType);
|
|
115
109
|
wrappers.push(tb.build(1));
|
package/bin/utils/utils.js
CHANGED
|
@@ -202,14 +202,14 @@ function getScriptOutputType(script, comment = '#') {
|
|
|
202
202
|
let wasSecond = false;
|
|
203
203
|
for (let match of matches) {
|
|
204
204
|
if (resType === 'void') {
|
|
205
|
-
resType = dgToTsTypeMap[match[1]];
|
|
205
|
+
resType = dgToTsTypeMap[match[1]] ?? 'any';
|
|
206
206
|
firstItemName = match[2];
|
|
207
207
|
} else {
|
|
208
208
|
if (!wasSecond) {
|
|
209
209
|
resType = `${firstItemName}: ${resType}`;
|
|
210
210
|
wasSecond = true;
|
|
211
211
|
}
|
|
212
|
-
resType = [resType, `${match[2]}: ${dgToTsTypeMap[match[1]]}`].join(', ');
|
|
212
|
+
resType = [resType, `${match[2]}: ${dgToTsTypeMap[match[1]] ?? 'any'}`].join(', ');
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
return wasSecond ? `{${resType}}` : resType;
|
package/package.json
CHANGED