-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
93 changed files
with
1,777 additions
and
1,696 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { charAt } from './charAt.js' | ||
import { join } from './join.js' | ||
import { slice } from './slice.js' | ||
import { toUpperCase } from './toUpperCase.js' | ||
|
||
/** | ||
* Capitalizes the first letter of a string. This is a runtime counterpart of `Capitalize<T>` from `src/types.d.ts`. | ||
* @param str the string to capitalize. | ||
* @returns the capitalized string. | ||
* @example capitalize('hello world') // 'Hello world' | ||
*/ | ||
export function capitalize<T extends string>(str: T): Capitalize<T> { | ||
return join([toUpperCase(charAt(str, 0)), slice(str, 1)]) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.