Files
supplier-dispatch-h5/node_modules/vant/es/utils/format/string.js
2023-08-11 10:45:20 +08:00

19 lines
353 B
JavaScript

var camelizeRE = /-(\w)/g;
export function camelize(str) {
return str.replace(camelizeRE, function (_, c) {
return c.toUpperCase();
});
}
export function padZero(num, targetLength) {
if (targetLength === void 0) {
targetLength = 2;
}
var str = num + '';
while (str.length < targetLength) {
str = '0' + str;
}
return str;
}