[arvados-workbench2] created: 2.6.0-14-ge11a6fa1

git repository hosting git at public.arvados.org
Thu May 11 18:24:17 UTC 2023


        at  e11a6fa13214f91ffc602e53574736174ca6e8e9 (commit)


commit e11a6fa13214f91ffc602e53574736174ca6e8e9
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Thu May 11 14:23:52 2023 -0400

    20493: isArrayOfType handles union type (optional) arrays
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/src/models/workflow.ts b/src/models/workflow.ts
index e85dce7a..59b81a1d 100644
--- a/src/models/workflow.ts
+++ b/src/models/workflow.ts
@@ -185,10 +185,13 @@ export const isPrimitiveOfType = (input: GenericCommandInputParameter<any, any>,
         : input.type === type;
 
 export const isArrayOfType = (input: GenericCommandInputParameter<any, any>, type: CWLType) =>
-    typeof input.type === 'object' &&
-        input.type.type === 'array'
-        ? input.type.items === type
-        : false;
+    input.type instanceof Array
+        ? (input.type.filter(t => typeof t === 'object' &&
+            t.type === 'array' &&
+            t.items === type).length > 0)
+        : (typeof input.type === 'object' &&
+            input.type.type === 'array' &&
+            input.type.items === type);
 
 export const stringifyInputType = ({ type }: CommandInputParameter) => {
     if (typeof type === 'string') {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list