Nav apraksta

utils-6b513b37.js 1.0KB

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