datagrok-tools 4.14.32 → 4.14.34

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.
@@ -129,7 +129,7 @@ async function runTesting(args) {
129
129
  let testsLeft = [];
130
130
  let testsToReproduce = [];
131
131
  for (let testData of organized) {
132
- if (!r.verbosePassed.includes(`${testData.params.category}: ${testData.params.test}`) && !r.verboseSkipped.includes(`${testData.params.category}: ${testData.params.test}`) && !r.verboseFailed.includes(`${testData.params.category}: ${testData.params.test}`) && !new RegExp(`${testData.params.category.trim()}[^\\n]*: (before|after)`).test(r.verboseFailed)) testsLeft.push(testData);
132
+ if (!r.verbosePassed.includes(`${testData.params.category}: ${testData.params.test}`) && !r.verboseSkipped.includes(`${testData.params.category}: ${testData.params.test}`) && !r.verboseFailed.includes(`${testData.params.category}: ${testData.params.test}`) && !new RegExp(`${testUtils.escapeRegex(testData.params.category.trim())}[^\n]*: *?(before|after)(\\(\\))?`).test(r.verboseFailed)) testsLeft.push(testData);
133
133
  if (r.verboseFailed.includes(`${testData.params.category}: ${testData.params.test} : Error:`)) {
134
134
  testsToReproduce.push(testData);
135
135
  }
@@ -8,6 +8,7 @@ exports.TestContext = void 0;
8
8
  exports.addColumnToCsv = addColumnToCsv;
9
9
  exports.addLogsToFile = addLogsToFile;
10
10
  exports.defaultLaunchParameters = void 0;
11
+ exports.escapeRegex = escapeRegex;
11
12
  exports.exitWithCode = exitWithCode;
12
13
  exports.getBrowserPage = getBrowserPage;
13
14
  exports.getDevKey = getDevKey;
@@ -549,4 +550,7 @@ async function addColumnToCsv(csv, columnName, defaultValue) {
549
550
  }
550
551
  });
551
552
  return result;
553
+ }
554
+ function escapeRegex(s) {
555
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
552
556
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.14.32",
3
+ "version": "4.14.34",
4
4
  "description": "Utility to upload and publish packages to Datagrok",
5
5
  "homepage": "https://github.com/datagrok-ai/public/tree/master/tools#readme",
6
6
  "dependencies": {
@@ -30,7 +30,8 @@
30
30
  "link": "npm link",
31
31
  "prepublishOnly": "babel bin --extensions .ts -d bin",
32
32
  "babel": "babel bin --extensions .ts -d bin",
33
- "build": "babel bin --extensions .ts -d bin"
33
+ "build": "babel bin --extensions .ts -d bin",
34
+ "debug-source-map": "babel bin --extensions .ts -d bin --source-maps true"
34
35
  },
35
36
  "bin": {
36
37
  "datagrok-upload": "./bin/_deprecated/upload.js",
@@ -347,26 +347,32 @@ class FuncGeneratorPlugin {
347
347
 
348
348
  _readReturnType(annotation) {
349
349
  let resultType = 'dynamic';
350
+ let nodeAnnotation = annotation;
350
351
  let isArray = false;
352
+ if (nodeAnnotation?.type === 'TSUnionType' &&
353
+ nodeAnnotation?.types?.length === 2 &&
354
+ nodeAnnotation?.types?.some((e)=> e?.type === 'TSNullKeyword'))
355
+ nodeAnnotation = nodeAnnotation.types.filter((e)=> e.type !== 'TSNullKeyword')[0];
356
+
357
+
351
358
  if (
352
- annotation &&
353
- annotation.type !== 'TSUnionType' &&
354
- annotation.type !== 'TSIntersectionType'
359
+ nodeAnnotation &&
360
+ nodeAnnotation.type !== 'TSUnionType' &&
361
+ nodeAnnotation.type !== 'TSIntersectionType'
355
362
  ) {
356
-
357
- if (annotation.typeName || annotation.type === 'TSTypeReference') {
363
+ if (nodeAnnotation.typeName || nodeAnnotation.type === 'TSTypeReference') {
358
364
  resultType =
359
- annotation.typeName?.right?.name ?? annotation.typeName?.name;
360
- } else if (annotation.type !== 'TSArrayType')
361
- resultType = this._getTypeNameFromNode(annotation);
362
- else if (annotation.elementType.type !== 'TSTypeReference') {
365
+ nodeAnnotation.typeName?.right?.name ?? nodeAnnotation.typeName?.name;
366
+ } else if (nodeAnnotation.type !== 'TSArrayType')
367
+ resultType = this._getTypeNameFromNode(nodeAnnotation);
368
+ else if (nodeAnnotation.elementType.type !== 'TSTypeReference') {
363
369
  isArray = true;
364
- resultType = this._getTypeNameFromNode(annotation?.elementType);
370
+ resultType = this._getTypeNameFromNode(nodeAnnotation?.elementType);
365
371
  } else {
366
372
  isArray = true;
367
373
  resultType =
368
- annotation?.elementType?.typeName?.name ||
369
- annotation?.elementType?.typeName?.right?.name;
374
+ nodeAnnotation?.elementType?.typeName?.name ||
375
+ nodeAnnotation?.elementType?.typeName?.right?.name;
370
376
  }
371
377
  }
372
378
  resultType = typesToAnnotation[resultType];