From: Peter Amstutz Date: Thu, 11 May 2023 18:50:11 +0000 (-0400) Subject: Merge branch '20493-optional-array' refs #20493 X-Git-Tag: 2.6.2^0 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/ef8180fa2f0b90b1656b1d8c7ef12bc6ea028a0a?hp=7f0ee8806944ff39e3545572ebad8f63b8e0938d Merge branch '20493-optional-array' refs #20493 Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- 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, : input.type === type; export const isArrayOfType = (input: GenericCommandInputParameter, 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') {