[improvement] adjust utils

This commit is contained in:
陈嘉涵
2019-06-06 11:49:39 +08:00
parent f5059ea6ba
commit d7a5be67fe
37 changed files with 96 additions and 82 deletions

View File

@@ -0,0 +1,9 @@
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;
}