-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add lowerCase and upperCase #47
Conversation
README.md
Outdated
### lowerCase | ||
|
||
This function converts a string to `lower case` at both runtime and type levels. | ||
_NOTE: this function will split by words and join them with `" "`._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion for a better warning?
I want it to be crystal clear that toUpperCase
and upperCase
are significantly different
(Same with the lower counterparts)
src/casing.ts
Outdated
/** | ||
* Transforms a string to lowercase, with words delimited by a space. | ||
*/ | ||
type LowerCase<T extends string> = Join<LowerCaseAll<Words<T>>, ' '> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type LowerCase<T extends string> = Join<LowerCaseAll<Words<T>>, ' '> | |
type LowerCase<T extends string> = Lowercase<DelimiterCase<T, ' '>> | |
function lowerCase<T extends string>(str: T): LowerCase<T> { | |
return toLowerCase(delimiterCase(str, ' ')) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for LowerCaseAll
README.md
Outdated
```ts | ||
import { lowerCase } from 'string-ts' | ||
|
||
const str = 'HELLO WORLD' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make it clearer
const str = 'HELLO WORLD' | |
const str = 'HELLO [WORLD]...' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.