mirror of
https://github.com/samuelcolvin/FastUI.git
synced 2023-12-01 22:22:11 +03:00
15 lines
393 B
TypeScript
15 lines
393 B
TypeScript
export enum DisplayChoices {
|
|
auto = 'auto',
|
|
plain = 'plain',
|
|
datetime = 'datetime',
|
|
date = 'date',
|
|
duration = 'duration',
|
|
as_title = 'as_title',
|
|
markdown = 'markdown',
|
|
json = 'json',
|
|
inline_code = 'inline_code',
|
|
}
|
|
|
|
// usage as_title('what_ever') > 'What Ever'
|
|
export const asTitle = (s: string): string => s.replace(/[_-]/g, ' ').replace(/(_|\b)\w/g, (l) => l.toUpperCase())
|