cosmo-ui
Version:
Common React components
19 lines (16 loc) • 404 B
text/typescript
export * from './event-utils'
export * from './random'
/**
* Replace camelCase with dashed-space
*
* @export
* @param {string} str
* @returns {string}
*/
export const dasherize = (str: string): string =>
str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`)
export const flatten = (arr: any[]): any[] =>
arr.reduce(
(acc: any[], itm: any) => acc.concat(itm),
[],
)