UNPKG

tav-ui

Version:
25 lines (21 loc) 695 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function camelize(event) { return event.replace(/-(\w)/g, (_, str) => { return str.toUpperCase(); }); } function capitalize(event) { return event ? event.charAt(0).toLocaleUpperCase() + event.slice(1) : ""; } function validateKebabCase(event) { if (!event || event.trim() === "") return "\u7EC4\u4EF6\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"; if (/[A-Z]/.test(event)) return "\u7EC4\u4EF6\u540D\u79F0\u8BF7\u9075\u5B88 kebab-case"; return true; } exports.camelize = camelize; exports.capitalize = capitalize; exports.validateKebabCase = validateKebabCase; //# sourceMappingURL=with-name2.js.map