+export const getInputLabel = (input: CommandInputParameter) => {
+ return `${input.label || input.id}`;
+};
+
+export const isRequiredInput = ({ type }: CommandInputParameter) => {
+ if (type instanceof Array) {
+ for (const t of type) {
+ if (t === CWLType.NULL) {
+ return false;
+ }
+ }
+ }
+ return true;
+};
+
+export const isPrimitiveOfType = (input: GenericCommandInputParameter<any, any>, type: CWLType) =>
+ input.type instanceof Array
+ ? input.type.indexOf(type) > -1
+ : 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;