code/config/case.ts

10 lines
190 B
TypeScript
Raw Normal View History

export function convertCase(str: string): string {
return str
.split(' ')
2021-10-17 18:41:15 +00:00
.reduce((p: string[], c) => {
p.push(c.toLowerCase());
return p;
}, [])
.join('-');
}