first
This commit is contained in:
19
node_modules/vant/es/utils/format/string.js
generated
vendored
Normal file
19
node_modules/vant/es/utils/format/string.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
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;
|
||||
}
|
Reference in New Issue
Block a user