Sin descripción

utils-82346768.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { _ as _defineProperty } from './_commonjsHelpers-aeb41076.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 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
  7. width: '36px',
  8. height: '36px'
  9. };
  10. // 防止重复添加导致的url不正确
  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 formatMoney(input) {
  26. var fuzz = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  27. if (isNaN(+input)) {
  28. return input;
  29. }
  30. return (+input).toFixed(fuzz);
  31. }
  32. function exportStyleSizeClass(styles, size) {
  33. return _defineProperty({}, styles[size], true);
  34. }
  35. export { addImageProcess as a, exportStyleSizeClass as e, formatMoney as f };
  36. //# sourceMappingURL=utils-82346768.js.map