export var getIamgeFromMedia = function getIamgeFromMedia(data) {
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'findAll';
  if (!data || !Array.isArray(data) || (data === null || data === void 0 ? void 0 : data.length) <= 0) {
    return type === 'findAll' ? [] : '';
  }
  if (type === 'findOne') {
    var _data$find;
    return ((_data$find = data.find(function (v) {
      return v.type === 'image' && !!v.url;
    })) === null || _data$find === void 0 ? void 0 : _data$find.url) || '';
  } else {
    return data.map(function (v) {
      if (v.type === 'image' && !!v.url) {
        return v.url;
      }
    });
  }
};