-
Notifications
You must be signed in to change notification settings - Fork 3
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
2 changed files
with
15 additions
and
5 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 |
---|---|---|
@@ -1,24 +1,32 @@ | ||
# change-case-all | ||
|
||
Change case functions for all cases in TypeScript and JavaScript. | ||
|
||
![CI](https://github.com/btxtiger/change-case-all/actions/workflows/ci.yml/badge.svg) | ||
[![npm](https://img.shields.io/npm/v/change-case-all.svg)](https://www.npmjs.com/package/change-case-all) | ||
[![npm](https://img.shields.io/npm/dm/change-case-all.svg)](https://www.npmjs.com/package/change-case-all) | ||
[![npm](https://img.shields.io/librariesio/release/npm/change-case-all)](https://www.npmjs.com/package/change-case-all) | ||
|
||
Combined version of all [`change-case`](https://github.com/blakeembrey/change-case) methods, so you do not need to install them separately. | ||
Tree shaking should still work if you use a module bundler. | ||
ESM and CJS bundles are included, also backwards compatible with [email protected]. | ||
|
||
`[email protected]` introduces a `Case` helper class, which can be used to access all methods. | ||
|
||
## Usage | ||
|
||
```shell script | ||
npm install --save change-case-all | ||
``` | ||
|
||
### Via class | ||
```ts | ||
import { Case } from 'change-case-all'; | ||
|
||
const camel = Case.camel('test string'); // testString | ||
const upper = Case.upper('test string'); // TEST STRING | ||
``` | ||
|
||
### Via functions | ||
```ts | ||
import { camelCase, upperCase, ... } from 'change-case-all'; | ||
|
||
|
@@ -27,7 +35,9 @@ const upper = upperCase('test string'); // TEST STRING | |
``` | ||
|
||
## Changelog | ||
|
||
### 2.0.0 | ||
|
||
- Updated dependencies to `[email protected]` | ||
- ParamCase → now KebabCase | ||
- HeaderCase → now TrainCase | ||
|
@@ -36,10 +46,12 @@ const upper = upperCase('test string'); // TEST STRING | |
- `[email protected]` failing in tests, thus kept at `3.0.3` | ||
|
||
## Links | ||
- **Original project:** https://github.com/blakeembrey/change-case | ||
|
||
- **Original project:** https://github.com/blakeembrey/change-case | ||
- **Bundled browser friendly version:** https://github.com/nitro404/change-case-bundled | ||
|
||
## Methods | ||
|
||
### Class based usage | ||
```ts | ||
import { Case } from 'change-case-all'; | ||
|
@@ -68,7 +80,6 @@ lowerFirst = Case.lowerFirst(str); // test string | |
upperFirst = Case.upperFirst(str); // Test string | ||
isUpper = Case.isUpper(str); // false | ||
isLower = Case.isLower(str); // true | ||
|
||
``` | ||
|
||
### Function based usage | ||
|
@@ -99,5 +110,4 @@ lowerFirst = lowerCaseFirst(str); // test string | |
upperFirst = upperCaseFirst(str); // Test string | ||
isUpper = isUpperCase(str); // false | ||
isLower = isLowerCase(str); // true | ||
|
||
``` |
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