datagrok-tools 4.14.44 → 4.14.45
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
CHANGED
|
@@ -413,11 +413,13 @@ class FuncGeneratorPlugin {
|
|
|
413
413
|
let resultType = 'void';
|
|
414
414
|
let nodeAnnotation = annotation;
|
|
415
415
|
let isArray = false;
|
|
416
|
+
let isNullable = false;
|
|
416
417
|
if (nodeAnnotation?.type === 'TSUnionType' &&
|
|
417
418
|
nodeAnnotation?.types?.length === 2 &&
|
|
418
419
|
nodeAnnotation?.types?.some((e)=> e?.type === 'TSNullKeyword' || e?.type === 'TSVoidKeyword'|| e?.type === 'TSUndefinedKeyword')) {
|
|
419
420
|
nodeAnnotation =
|
|
420
421
|
nodeAnnotation.types.filter((e)=> e.type !== 'TSNullKeyword' || e?.type === 'TSVoidKeyword' || e?.type === 'TSUndefinedKeyword')[0];
|
|
422
|
+
isNullable = true;
|
|
421
423
|
}
|
|
422
424
|
|
|
423
425
|
|
|
@@ -442,6 +444,7 @@ class FuncGeneratorPlugin {
|
|
|
442
444
|
}
|
|
443
445
|
}
|
|
444
446
|
let anotationType = typesToAnnotation[resultType];
|
|
447
|
+
resultType = isNullable? 'any' : resultType;
|
|
445
448
|
if (isArray && anotationType) anotationType = `list<${anotationType}>`;
|
|
446
449
|
return [anotationType ?? 'dynamic', `${resultType}${isArray? '[]': ''}` ?? 'any'];
|
|
447
450
|
}
|