No Description

utils-b800dc99.js 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict';
  2. var defineProperty = require('./defineProperty-ba7cd53d.js');
  3. var IMAGE_PROCESS = '?x-oss-process=image/resize,h_350';
  4. var IMAGE_PROCESS_SMALL = '?x-oss-process=image/resize,h_100';
  5. var IMAGE_PROCESS_LARGE = '?x-oss-process=image/resize,h_500';
  6. function addImageProcess(url) {
  7. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
  8. width: '36px',
  9. height: '36px'
  10. };
  11. if (url && url.indexOf('x-oss-process') > -1) {
  12. return url;
  13. }
  14. if (options.small) {
  15. return url + IMAGE_PROCESS_SMALL;
  16. }
  17. if (options.large) {
  18. return url + IMAGE_PROCESS_LARGE;
  19. }
  20. if (options.custom) {
  21. return "".concat(url, "?x-oss-process=image/resize,limit_0,m_fill,w_").concat(options.width, ",h_").concat(options.height);
  22. }
  23. return url + IMAGE_PROCESS;
  24. }
  25. function exportStyleSizeClass(styles, size) {
  26. return defineProperty._defineProperty({}, styles[size], true);
  27. }
  28. exports.addImageProcess = addImageProcess;
  29. exports.exportStyleSizeClass = exportStyleSizeClass;
  30. //# sourceMappingURL=utils-b800dc99.js.map