function wbUuidsToCwl(obj) { if (obj instanceof Array) { const res = []; for (let k in obj) { res[k] = uuidsToCwl(obj[k]); } return res; } if (typeof(obj) === 'string' && (/^[0-9a-z]{5}-[0-9a-z]{5}-[0-9a-z]{15}/.exec(obj) || /^[0-9a-f]{32}\+[0-9]+/.exec(obj))) { const isDirectory = obj.endsWith('/'); return { 'class': (isDirectory ? 'Directory' : 'File'), 'location': 'keep:' + (isDirectory ? obj.substr(0, obj.length - 1) : obj) }; } throw Error('Expected Arvados path or array of paths'); } export default wbUuidsToCwl;