'use strict';

const fields = [
  'tags',
  'tags_vision',
  'tags_verified'
]

module.exports = metadata => {
  fields.forEach(field => {
    const value = metadata[field];
    if(typeof(value) === 'string' && value !== '') {
      metadata[field] = value.split(',');
    } else {
      metadata[field] = [];
    }
  });
  return metadata;
};

@@ -39,25 +39,8 @@
 s',%0A
-  'tags_vision',%0A
   't

Remove tags_vision field from splitting of tags -- as it is empty it will have no effect