Travis build: 909
This commit is contained in:
25
README.md
25
README.md
@ -406,6 +406,7 @@ _30s.average(1, 2, 3);
|
||||
* [`byteSize`](#bytesize)
|
||||
* [`capitalize`](#capitalize)
|
||||
* [`capitalizeEveryWord`](#capitalizeeveryword)
|
||||
* [`compactWhitespace`](#compactwhitespace)
|
||||
* [`CSVToArray`](#csvtoarray)
|
||||
* [`CSVToJSON`](#csvtojson-)
|
||||
* [`decapitalize`](#decapitalize)
|
||||
@ -664,7 +665,6 @@ const pipeAsyncFunctions = (...fns) => arg => fns.reduce((p, f) => p.then(f), Pr
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
|
||||
const sum = pipeAsyncFunctions(
|
||||
x => x + 1,
|
||||
x => new Promise(resolve => setTimeout(() => resolve(x + 2), 1000)),
|
||||
@ -2313,7 +2313,6 @@ Use `Array.prototype.filter()` to find array elements that return truthy values
|
||||
The `func` is invoked with three arguments (`value, index, array`).
|
||||
|
||||
```js
|
||||
|
||||
const remove = (arr, func) =>
|
||||
Array.isArray(arr)
|
||||
? arr.filter(func).reduce((acc, val) => {
|
||||
@ -7728,6 +7727,28 @@ capitalizeEveryWord('hello world!'); // 'Hello World!'
|
||||
|
||||
<br>[⬆ Back to top](#contents)
|
||||
|
||||
### compactWhitespace
|
||||
|
||||
Returns a string with whitespaces compacted.
|
||||
|
||||
Use `String.prototype.replace()` with a regular expression to replace all occurences of 2 or more whitespace characters with a single space.
|
||||
|
||||
```js
|
||||
const compactWhitespace = str => str.replace(/\s{2,}/g, ' ');
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
compactWhitespace('Lorem Ipsum'); // 'Lorem Ipsum'
|
||||
compactWhitespace('Lorem \n Ipsum'); // 'Lorem Ipsum'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#contents)
|
||||
|
||||
### CSVToArray
|
||||
|
||||
Converts a comma-separated values (CSV) string to a 2D array.
|
||||
|
||||
Reference in New Issue
Block a user