Travis build: 574
This commit is contained in:
72
README.md
72
README.md
@ -221,6 +221,7 @@
|
|||||||
* [`repeatString`](#repeatstring)
|
* [`repeatString`](#repeatstring)
|
||||||
* [`reverseString`](#reversestring)
|
* [`reverseString`](#reversestring)
|
||||||
* [`sortCharactersInString`](#sortcharactersinstring)
|
* [`sortCharactersInString`](#sortcharactersinstring)
|
||||||
|
* [`splitLines`](#splitlines)
|
||||||
* [`toCamelCase`](#tocamelcase)
|
* [`toCamelCase`](#tocamelcase)
|
||||||
* [`toKebabCase`](#tokebabcase)
|
* [`toKebabCase`](#tokebabcase)
|
||||||
* [`toSnakeCase`](#tosnakecase)
|
* [`toSnakeCase`](#tosnakecase)
|
||||||
@ -2574,55 +2575,6 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va
|
|||||||
```js
|
```js
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const max = (...arr) => Math.max(...[].concat(...arr);
|
const max = (...arr) => Math.max(...[].concat(...arr);
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -3455,6 +3407,28 @@ sortCharactersInString('cabbage'); // 'aabbceg'
|
|||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
### splitLines
|
||||||
|
|
||||||
|
Splits a multiline string into an array of lines.
|
||||||
|
|
||||||
|
Use `String.split()` and a regular expression to match line breaks and create an array.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const splitLines = str => str.split(/\r?\n/);
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
splitLines('This\nis a\nmultiline\nstring.\n'); // ['This', 'is a', 'multiline', 'string' , '']
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
### toCamelCase
|
### toCamelCase
|
||||||
|
|
||||||
Converts a string to camelcase.
|
Converts a string to camelcase.
|
||||||
|
|||||||
@ -242,6 +242,7 @@
|
|||||||
<a class="sublink-1" href="#repeatstring">repeatString</a>
|
<a class="sublink-1" href="#repeatstring">repeatString</a>
|
||||||
<a class="sublink-1" href="#reversestring">reverseString</a>
|
<a class="sublink-1" href="#reversestring">reverseString</a>
|
||||||
<a class="sublink-1" href="#sortcharactersinstring">sortCharactersInString</a>
|
<a class="sublink-1" href="#sortcharactersinstring">sortCharactersInString</a>
|
||||||
|
<a class="sublink-1" href="#splitlines">splitLines</a>
|
||||||
<a class="sublink-1" href="#tocamelcase">toCamelCase</a>
|
<a class="sublink-1" href="#tocamelcase">toCamelCase</a>
|
||||||
<a class="sublink-1" href="#tokebabcase">toKebabCase</a>
|
<a class="sublink-1" href="#tokebabcase">toKebabCase</a>
|
||||||
<a class="sublink-1" href="#tosnakecase">toSnakeCase</a>
|
<a class="sublink-1" href="#tosnakecase">toSnakeCase</a>
|
||||||
@ -1217,55 +1218,6 @@ lcm([1, 3, 4], 5); // 60
|
|||||||
<p>Use <code>Math.max()</code> combined with the spread operator (<code>...</code>) to get the maximum value in the array.</p>
|
<p>Use <code>Math.max()</code> combined with the spread operator (<code>...</code>) to get the maximum value in the array.</p>
|
||||||
<pre><code class="language-js">
|
<pre><code class="language-js">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const max = (...arr) => Math.max(...[].concat(...arr);
|
const max = (...arr) => Math.max(...[].concat(...arr);
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<pre><code class="language-js">max([10, 1, 5]); // 10
|
<pre><code class="language-js">max([10, 1, 5]); // 10
|
||||||
@ -1620,6 +1572,13 @@ Combine characters to get a string using <code>join('')</code>.</p>
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
<pre><code class="language-js">sortCharactersInString('cabbage'); // 'aabbceg'
|
<pre><code class="language-js">sortCharactersInString('cabbage'); // 'aabbceg'
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="splitlines">splitLines</h3></div><div class="section double-padded">
|
||||||
|
<p>Splits a multiline string into an array of lines.</p>
|
||||||
|
<p>Use <code>String.split()</code> and a regular expression to match line breaks and create an array.</p>
|
||||||
|
<pre><code class="language-js">const splitLines = str => str.split(/\r?\n/);
|
||||||
|
</code></pre>
|
||||||
|
<pre><code class="language-js">splitLines('This\nis a\nmultiline\nstring.\n'); // ['This', 'is a', 'multiline', 'string' , '']
|
||||||
|
</code></pre>
|
||||||
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="tocamelcase">toCamelCase</h3></div><div class="section double-padded">
|
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="tocamelcase">toCamelCase</h3></div><div class="section double-padded">
|
||||||
<p>Converts a string to camelcase.</p>
|
<p>Converts a string to camelcase.</p>
|
||||||
<p>Break the string into words and combine them capitalizing the first letter of each word.
|
<p>Break the string into words and combine them capitalizing the first letter of each word.
|
||||||
|
|||||||
@ -6,6 +6,7 @@ Use `Math.max()` combined with the spread operator (`...`) to get the maximum va
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
||||||
|
|
||||||
const max = (...arr) => Math.max(...[].concat(...arr);
|
const max = (...arr) => Math.max(...[].concat(...arr);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user