Travis build: 1173

This commit is contained in:
30secondsofcode
2018-01-11 10:00:38 +00:00
parent 3c149253b1
commit f93efa9f58
3 changed files with 34 additions and 1 deletions

View File

@ -277,6 +277,7 @@ average(1, 2, 3);
* [`byteSize`](#bytesize) * [`byteSize`](#bytesize)
* [`capitalize`](#capitalize) * [`capitalize`](#capitalize)
* [`capitalizeEveryWord`](#capitalizeeveryword) * [`capitalizeEveryWord`](#capitalizeeveryword)
* [`decapitalize`](#decapitalize)
* [`escapeHTML`](#escapehtml) * [`escapeHTML`](#escapehtml)
* [`escapeRegExp`](#escaperegexp) * [`escapeRegExp`](#escaperegexp)
* [`fromCamelCase`](#fromcamelcase) * [`fromCamelCase`](#fromcamelcase)
@ -4139,6 +4140,31 @@ capitalizeEveryWord('hello world!'); // 'Hello World!'
<br>[⬆ Back to top](#table-of-contents) <br>[⬆ Back to top](#table-of-contents)
### decapitalize
Decapitalizes the first letter of a string.
Use array destructuring and `String.toLowerCase()` to decapitalize first letter, `...rest` to get array of characters after first letter and then `Array.join('')` to make it a string again.
Omit the `upperRest` parameter to keep the rest of the string intact, or set it to `true` to convert to uppercase.
```js
const decapitalize = ([first, ...rest], upperRest = false) =>
first.toLowerCase() + (upperRest ? rest.join('').toUpperCase() : rest.join(''));
```
<details>
<summary>Examples</summary>
```js
decapitalize('FooBar'); // 'fooBar'
decapitalize('FooBar', true); // 'fOOBAR'
```
</details>
<br>[⬆ Back to top](#table-of-contents)
### escapeHTML ### escapeHTML
Escapes a string for use in HTML. Escapes a string for use in HTML.
@ -5179,6 +5205,7 @@ const httpPost = (url, callback, data = null, err = console.error) => {
const newPost = { const newPost = {
"userId": 1, "userId": 1,
"id": 1337, "id": 1337,

File diff suppressed because one or more lines are too long

View File

@ -26,6 +26,7 @@ const httpPost = (url, callback, data = null, err = console.error) => {
const newPost = { const newPost = {
"userId": 1, "userId": 1,
"id": 1337, "id": 1337,