main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | # Pascal 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 of capitalized words without separators.
|
---|
8 |
|
---|
9 | ## Installation
|
---|
10 |
|
---|
11 | ```
|
---|
12 | npm install pascal-case --save
|
---|
13 | ```
|
---|
14 |
|
---|
15 | ## Usage
|
---|
16 |
|
---|
17 | ```js
|
---|
18 | import { pascalCase } from "pascal-case";
|
---|
19 |
|
---|
20 | pascalCase("string"); //=> "String"
|
---|
21 | pascalCase("dot.case"); //=> "DotCase"
|
---|
22 | pascalCase("PascalCase"); //=> "PascalCase"
|
---|
23 | pascalCase("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 `pascalCaseTransformMerge`:
|
---|
31 |
|
---|
32 | ```js
|
---|
33 | import { pascalCaseTransformMerge } from "pascal-case";
|
---|
34 |
|
---|
35 | pascalCase("version 12", { transform: pascalCaseTransformMerge }); //=> "Version12"
|
---|
36 | ```
|
---|
37 |
|
---|
38 | ## License
|
---|
39 |
|
---|
40 | MIT
|
---|
41 |
|
---|
42 | [npm-image]: https://img.shields.io/npm/v/pascal-case.svg?style=flat
|
---|
43 | [npm-url]: https://npmjs.org/package/pascal-case
|
---|
44 | [downloads-image]: https://img.shields.io/npm/dm/pascal-case.svg?style=flat
|
---|
45 | [downloads-url]: https://npmjs.org/package/pascal-case
|
---|
46 | [bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/pascal-case.svg
|
---|
47 | [bundlephobia-url]: https://bundlephobia.com/result?p=pascal-case
|
---|
Note:
See
TracBrowser
for help on using the repository browser.