datagrok-tools 4.14.22 → 4.14.23

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.
@@ -35,6 +35,7 @@ function check(args) {
35
35
  }
36
36
  }
37
37
  function runChecks(packagePath, soft = false) {
38
+ if (packagePath.includes(`${_path.default.sep}node_modules${_path.default.sep}`)) return true;
38
39
  const files = _ignoreWalk.default.sync({
39
40
  path: packagePath,
40
41
  ignoreFiles: ['.npmignore', '.gitignore']
@@ -194,10 +194,25 @@ const nameAnnRegex = exports.nameAnnRegex = /\s*(name[^:]*): ([^\n\r\[\{]+)/;
194
194
  const nameRegex = exports.nameRegex = /(?:|(?:static)(?:export )(?:async ))\s+function\s+([a-zA-Z_][a-zA-Z0-9_$]*)\s*\((.*?).*/;
195
195
  const absUrlRegex = exports.absUrlRegex = new RegExp('^(?:[a-z+]+:)?//', 'i');
196
196
  function getScriptOutputType(script, comment = '#') {
197
- const regex = new RegExp(`${comment}\\s*output:\\s?([a-z_]+)\\s*`);
198
- const match = script.match(regex);
199
- if (!match) return 'void';
200
- return dgToTsTypeMap[match[1]] || 'any';
197
+ const regex = /\s*output:\s?([a-z_]+)\s*([^\s]*)/g;
198
+ const matches = script.matchAll(regex);
199
+ if (!matches) return 'void';
200
+ let resType = 'void';
201
+ let firstItemName = '';
202
+ let wasSecond = false;
203
+ for (let match of matches) {
204
+ if (resType === 'void') {
205
+ resType = dgToTsTypeMap[match[1]];
206
+ firstItemName = match[2];
207
+ } else {
208
+ if (!wasSecond) {
209
+ resType = `${firstItemName}: ${resType}`;
210
+ wasSecond = true;
211
+ }
212
+ resType = [resType, `${match[2]}: ${dgToTsTypeMap[match[1]]}`].join(', ');
213
+ }
214
+ }
215
+ return wasSecond ? `{${resType}}` : resType;
201
216
  }
202
217
  ;
203
218
  function getScriptInputs(script, comment = '#') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.14.22",
3
+ "version": "4.14.23",
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": {