UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

1 lines 597 B
{"version":3,"file":"key-to-title.mjs","names":[],"sources":["../../../../../src/libs/collection/custom-fields/utils/key-to-title.ts"],"sourcesContent":["const keyToTitle = (key: string): string => {\n\tif (typeof key !== \"string\") return key;\n\n\tconst title = key\n\t\t.split(/[-_]/g)\n\t\t.map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t.join(\" \");\n\n\treturn title;\n};\n\nexport default keyToTitle;\n"],"mappings":"AAAA,MAAM,EAAc,GACf,OAAO,GAAQ,SAEL,EACZ,MAAM,OAAO,CAAC,CACd,IAAK,GAAS,EAAK,OAAO,CAAC,CAAC,CAAC,YAAY,EAAI,EAAK,MAAM,CAAC,CAAC,CAAC,CAC3D,KAAK,GAEI,EAPyB"}