main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[79a0317] | 1 | # Camel Case
|
---|
| 2 |
|
---|
| 3 | [![NPM version][npm-image]][npm-url]
|
---|
| 4 | [![NPM downloads][downloads-image]][downloads-url]
|
---|
| 5 | [![Bundle size][bundlephobia-image]][bundlephobia-url]
|
---|
| 6 |
|
---|
| 7 | > Transform into a string with the separator denoted by the next word capitalized.
|
---|
| 8 |
|
---|
| 9 | ## Installation
|
---|
| 10 |
|
---|
| 11 | ```
|
---|
| 12 | npm install camel-case --save
|
---|
| 13 | ```
|
---|
| 14 |
|
---|
| 15 | ## Usage
|
---|
| 16 |
|
---|
| 17 | ```js
|
---|
| 18 | import { camelCase } from "camel-case";
|
---|
| 19 |
|
---|
| 20 | camelCase("string"); //=> "string"
|
---|
| 21 | camelCase("dot.case"); //=> "dotCase"
|
---|
| 22 | camelCase("PascalCase"); //=> "pascalCase"
|
---|
| 23 | camelCase("version 1.2.10"); //=> "version_1_2_10"
|
---|
| 24 | ```
|
---|
| 25 |
|
---|
| 26 | The function also accepts [`options`](https://github.com/blakeembrey/change-case#options).
|
---|
| 27 |
|
---|
| 28 | ### Merge Numbers
|
---|
| 29 |
|
---|
| 30 | If you'd like to remove the behavior prefixing `_` before numbers, you can use `camelCaseTransformMerge`:
|
---|
| 31 |
|
---|
| 32 | ```js
|
---|
| 33 | import { camelCaseTransformMerge } from "camel-case";
|
---|
| 34 |
|
---|
| 35 | camelCase("version 12", { transform: camelCaseTransformMerge }); //=> "version12"
|
---|
| 36 | ```
|
---|
| 37 |
|
---|
| 38 | ## License
|
---|
| 39 |
|
---|
| 40 | MIT
|
---|
| 41 |
|
---|
| 42 | [npm-image]: https://img.shields.io/npm/v/camel-case.svg?style=flat
|
---|
| 43 | [npm-url]: https://npmjs.org/package/camel-case
|
---|
| 44 | [downloads-image]: https://img.shields.io/npm/dm/camel-case.svg?style=flat
|
---|
| 45 | [downloads-url]: https://npmjs.org/package/camel-case
|
---|
| 46 | [bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/camel-case.svg
|
---|
| 47 | [bundlephobia-url]: https://bundlephobia.com/result?p=camel-case
|
---|
Note:
See
TracBrowser
for help on using the repository browser.