Skip to content

Commit

Permalink
refactor: split files
Browse files Browse the repository at this point in the history
  • Loading branch information
jly36963 committed Oct 10, 2023
1 parent 091f67b commit fffe756
Show file tree
Hide file tree
Showing 93 changed files with 1,777 additions and 1,696 deletions.
14 changes: 14 additions & 0 deletions src/capitalize.ts
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)])
}
198 changes: 0 additions & 198 deletions src/casing.test.ts

This file was deleted.

Loading

0 comments on commit fffe756

Please sign in to comment.