datagrok-tools 4.14.54 → 4.14.56

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.
@@ -146,6 +146,11 @@ function getFuncAnnotation(data, comment = '//', sep = '\n') {
146
146
  if (input?.options?.type || input?.options?.options?.type) type = input?.options?.type ?? input?.options?.options?.type;else if (annotationType) {
147
147
  if (isArray) type = `list<${annotationType}>`;else type = annotationType;
148
148
  } else type = 'dynamic';
149
+
150
+ // if ((input as any)?.options?.type === 'categorical' || (input as any)?.options?.options?.type === 'categorical')
151
+ // console.log(input);
152
+ // console.log(input);
153
+
149
154
  const options = input?.options?.options ? buildStringOfOptions(input.options ?? {}) : '';
150
155
  const functionName = (input.options?.name ? input?.options?.name : ` ${input.name?.replaceAll('.', '')}`)?.trim();
151
156
 
@@ -192,7 +197,7 @@ function buildStringOfOptions(input) {
192
197
  if (opt['initialValue'] && /[A-Za-z]/.test(opt['initialValue']) && !opt['initialValue'].includes('\'') && !opt['initialValue'].includes('"') && !nonquotedValues.includes(opt['initialValue'])) opt['initialValue'] = `'${opt['initialValue']}'`;
193
198
  if (opt['initialValue']) defaultValue = `= ${opt['initialValue']}`;
194
199
  for (const [key, value] of Object.entries(opt)) {
195
- if (key === 'initialValue' || key === 'name' || key === 'type' && !input?.options?.key) continue;
200
+ if (key === 'initialValue') continue;
196
201
  let val = value;
197
202
  let option = key;
198
203
  option = decoratorOptionToAnnotation.get(option) ?? option;
@@ -275,7 +275,7 @@ async function loadTestsList(packages, core = false) {
275
275
  for (const testPackage of packageTestsData) {
276
276
  for (const key in testPackage.tests) {
277
277
  if (testPackage.tests.hasOwnProperty(key)) {
278
- for (const testValue of testPackage.tests[key].tests) {
278
+ for (const testValue of testPackage.tests[key]?.tests ?? []) {
279
279
  testValue.packageName = testPackage.packageName;
280
280
  testsList.push(testValue);
281
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.14.54",
3
+ "version": "4.14.56",
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": {
@@ -242,11 +242,11 @@ class FuncGeneratorPlugin {
242
242
  resultMap.set(key, this._evalLiteral(prop.value));
243
243
  }
244
244
 
245
- if (optionsToAdd.size > 0)
246
- resultMap.set('options', {...(resultMap.get('options') ?? {}), ...Object.fromEntries(optionsToAdd)});
245
+ for (const [key, value] of optionsToAdd)
246
+ resultMap.set(key, value);
247
247
  if (resultObj)
248
248
  resultMap.set('outputs', [resultObj]);
249
-
249
+
250
250
  return resultMap;
251
251
  }
252
252