IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
629B

  1. function wbInputSpecInfo(inputSpec) {
  2. const isFile = (inputSpec.type === 'File' || inputSpec.type === 'File[]' ||
  3. (inputSpec.type.type === 'array' && [].concat(inputSpec.type.items).indexOf('File') !== -1));
  4. const isDirectory = (inputSpec.type === 'Directory' || inputSpec.type === 'Directory[]' ||
  5. (inputSpec.type.type === 'array' && [].concat(inputSpec.type.items).indexOf('Directory') !== -1));
  6. const isArray = (inputSpec.type === 'File[]' || inputSpec.type === 'Directory[]' ||
  7. inputSpec.type.type === 'array');
  8. return { isFile, isDirectory, isArray };
  9. }
  10. export default wbInputSpecInfo;