mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
10 lines
238 B
TypeScript
10 lines
238 B
TypeScript
const camelizeRE = /-(\w)/g;
|
|
|
|
export function camelize(str: string): string {
|
|
return str.replace(camelizeRE, (_, c) => c.toUpperCase());
|
|
}
|
|
|
|
export function padZero(num: number | string): string {
|
|
return (num < 10 ? '0' : '') + num;
|
|
}
|