datagrok-tools 4.14.19 → 4.14.21
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/bin/utils/utils.js
CHANGED
|
@@ -201,10 +201,10 @@ function getScriptOutputType(script, comment = '#') {
|
|
|
201
201
|
}
|
|
202
202
|
;
|
|
203
203
|
function getScriptInputs(script, comment = '#') {
|
|
204
|
-
const regex = new RegExp(`${comment}\\s*input:\\s?([a-z_]+)
|
|
204
|
+
const regex = new RegExp(`${comment}\\s*input:\\s?([a-z_]+)(?:<[^>]*>)?\\s+(\\w+)(?:[^{\\n]*{[^}\\n]*})?`, 'g');
|
|
205
205
|
const inputs = [];
|
|
206
206
|
for (const match of script.matchAll(regex)) {
|
|
207
|
-
const isOptional = /isOptional\s*:\s*true/.test(match[0]);
|
|
207
|
+
const isOptional = /isOptional\s*:\s*true/.test(match[0]) || /optional\s*:\s*true/.test(match[0]);
|
|
208
208
|
const type = dgToTsTypeMap[match[1]] || 'any';
|
|
209
209
|
const name = match[2];
|
|
210
210
|
inputs.push({
|
package/package.json
CHANGED