chore(cli): remove decamelize pkg for compatiblity issues

This commit is contained in:
陈嘉涵
2019-12-30 15:14:13 +08:00
parent 16cbfd2c85
commit 2b438f84cd
8 changed files with 23 additions and 39 deletions

View File

@@ -20,6 +20,13 @@ function iframeReady(iframe, callback) {
const ua = navigator.userAgent.toLowerCase();
const isMobile = /ios|iphone|ipod|ipad|android/.test(ua);
export function decamelize(str, sep = '-') {
return str
.replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2')
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + sep + '$2')
.toLowerCase();
}
export {
isMobile,
iframeReady