"use strict";
const uni_modules_uviewPro_libs_function_test = require("./test.js");
function addUnit(value = "auto", unit = "rpx") {
  const strValue = String(value);
  if (!strValue)
    return "";
  if (strValue === "auto")
    return strValue;
  if (strValue.includes(" ")) {
    return strValue.split(" ").map((s) => {
      if (s === "auto" || /^-?\d*\.?\d+(%|px|rpx|em|rem|vh|vw)$/.test(s))
        return s;
      return uni_modules_uviewPro_libs_function_test.test.number(s) ? `${s}${unit}` : s;
    }).join(" ");
  }
  if (/^-?\d*\.?\d+(%|px|rpx|em|rem|vh|vw)$/.test(strValue))
    return strValue;
  return uni_modules_uviewPro_libs_function_test.test.number(strValue) ? `${strValue}${unit}` : strValue;
}
exports.addUnit = addUnit;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-pro/libs/function/addUnit.js.map
