UNPKG

@danielhaim/titlecaser

Version:

A powerful utility for transforming text to title case with support for multiple style guides and extensive customization options.

18 lines (14 loc) 440 B
import { TitleCaser } from './src/TitleCaser.js'; if (String.prototype.toTitleCase === undefined) { String.prototype.toTitleCase = function (options) { const titleCaser = new TitleCaser(options); return titleCaser.toTitleCase(this); }; } // Export for web environment if (typeof window !== 'undefined' && window.document) { window.TitleCaser = TitleCaser; } // ESM exports export { TitleCaser }; export default TitleCaser;