datagrok-tools 4.14.46 → 4.14.48
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.
|
@@ -156,7 +156,7 @@ function getFuncAnnotation(data, comment = '//', sep = '\n') {
|
|
|
156
156
|
for (const output of data.outputs) {
|
|
157
157
|
if (output.type !== 'void') {
|
|
158
158
|
// eslint-disable-next-line max-len
|
|
159
|
-
s += comment + 'output: ' + output.type + (output.name ? ` ${output.name}${output.options ? ` ${buildStringOfOptions(output
|
|
159
|
+
s += comment + 'output: ' + output.type + (output.name ? ` ${output.name}${output.options ? ` ${buildStringOfOptions(output)}` : ''}` : '') + sep;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
@@ -463,7 +463,7 @@ function generateFunc(annotation, funcName, sep = '\n', className = '', inputs =
|
|
|
463
463
|
const funcArguments = inputs.map(e => e.name).join(', ');
|
|
464
464
|
const returnType = output ? primitives.has(output) ? !isAsync ? `: ${output} ` : `: Promise<${output}> ` : !isAsync ? `: any ` : `: Promise<any> ` : '';
|
|
465
465
|
// eslint-disable-next-line max-len
|
|
466
|
-
return sep + annotation + `export ${isAsync ? 'async ' : ''}function ${funcName}(${funcSigNature}) ${returnType}{${sep} ${output !== 'void' ? 'return ' : ''}${className.length > 0 ? `${className}.` : ''}${funcName}(${funcArguments});${sep}}${sep}`;
|
|
466
|
+
return sep + annotation + `export ${isAsync ? 'async ' : ''}function ${funcName}(${funcSigNature}) ${returnType}{${sep} ${output !== 'void' ? 'return ' : ''}${isAsync ? 'await ' : ''}${className.length > 0 ? `${className}.` : ''}${funcName}(${funcArguments});${sep}}${sep}`;
|
|
467
467
|
}
|
|
468
468
|
function generateImport(className, path, sep = '\n') {
|
|
469
469
|
return `import {${className}} from '${path}';${sep}`;
|
package/package.json
CHANGED
|
@@ -197,8 +197,6 @@ class FuncGeneratorPlugin {
|
|
|
197
197
|
|
|
198
198
|
// if (!funcAnnotaionOptions.name) funcAnnotaionOptions.name = identifierName;
|
|
199
199
|
|
|
200
|
-
console.log(funcName);
|
|
201
|
-
console.log(funcAnnotaionOptions.name);
|
|
202
200
|
if (funcAnnotaionOptions.name === funcName)
|
|
203
201
|
funcAnnotaionOptions.name = undefined;
|
|
204
202
|
|
|
@@ -253,7 +251,6 @@ class FuncGeneratorPlugin {
|
|
|
253
251
|
optionsToAdd.set(key, this._evalLiteral(prop.value));
|
|
254
252
|
else
|
|
255
253
|
resultMap.set(key, this._evalLiteral(prop.value));
|
|
256
|
-
|
|
257
254
|
}
|
|
258
255
|
|
|
259
256
|
if (optionsToAdd.size > 0)
|