@web3r/flowerkit
Version:
Tree-shakable JavaScript and TypeScript utility library for frontend/browser apps: DOM, events, arrays, objects, strings, date, JSON, and network helpers (ESM/CJS, SSR-friendly).
15 lines (14 loc) • 544 B
text/typescript
export type TGetWordsArgs = Parameters<typeof getWords>;
export type TGetWordsReturn = ReturnType<typeof getWords>;
/**
* Splits a string into words:
* Splits camelCase boundaries: "helloWorld" -> "hello World"
* Removes non-letter separators
*
* @param {string} str Source string
* @returns {string[]} Array of words (letters-only segments)
* @throws {TypeError} If str is not a string
* @example
* getWords("helloWorld! what's_up?"); // ["hello","World","what","s","up"]
*/
export declare const getWords: (str: string) => string[];