wordswords 函数是所有大小写转换函数的基础。它接收一个字符串,并将其分解为一个由单词组成的数组。它能处理驼峰式、下划线式、短横线式以及缩写词。
import { words } from '@movk/core'
words('helloWorld') // => ['hello', 'World']
words('hello_world') // => ['hello', 'world']
words('hello-world') // => ['hello', 'world']
words('XMLHttpRequest') // => ['XML', 'Http', 'Request']
words(str: string): string[]
ac5db — feat: 为核心utils模块添加单元测试