diff --git a/package.json b/package.json index 0f7a54c7..8e991847 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "radash", - "version": "12.1.0", + "version": "12.1.1", "description": "Functional utility library - modern, simple, typed, powerful", "main": "dist/cjs/index.cjs", "module": "dist/esm/index.mjs", diff --git a/src/string.ts b/src/string.ts index 40de090d..5dfcc54c 100644 --- a/src/string.ts +++ b/src/string.ts @@ -4,10 +4,11 @@ * capitalize('hello') -> 'Hello' * capitalize('va va voom') -> 'Va va voom' */ -export const capitalize = (str: string): string => { - if (!str || str.length === 0) return '' +export const capitalize = (str: Str): Capitalize => { + if (!str || str.length === 0) return '' as Capitalize const lower = str.toLowerCase() - return lower.substring(0, 1).toUpperCase() + lower.substring(1, lower.length) + return (lower.substring(0, 1).toUpperCase() + + lower.substring(1, lower.length)) as Capitalize } /**