Travis build: 537

This commit is contained in:
30secondsofcode
2018-09-27 13:59:46 +00:00
parent 65a8221fb8
commit 10e3673e14
13 changed files with 39 additions and 13 deletions

View File

@ -409,6 +409,7 @@ average(1, 2, 3);
* [`escapeHTML`](#escapehtml)
* [`escapeRegExp`](#escaperegexp)
* [`fromCamelCase`](#fromcamelcase)
* [`indentString`](#indentstring)
* [`isAbsoluteURL`](#isabsoluteurl)
* [`isAnagram`](#isanagram)
* [`isLowerCase`](#islowercase)
@ -7453,6 +7454,29 @@ fromCamelCase('someJavascriptProperty', '_'); // 'some_javascript_property'
<br>[⬆ Back to top](#table-of-contents)
### indentString
Indents each line in the provided string.
Use `String.replace` and a regular expression to add the character specified by `indent` `count` times at the start of each line.
Omit the third parameter, `indent`, to use a default indentation character of `' '`.
```js
const indentString = (str, count, indent = ' ') => str.replace(/^/gm, indent.repeat(count));
```
<details>
<summary>Examples</summary>
```js
indentString('Lorem\nIpsum', 2); // ' Lorem\n Ipsum'
indentString('Lorem\nIpsum', 2, '_'); // '__Lorem\n__Ipsum'
```
</details>
<br>[⬆ Back to top](#table-of-contents)
### isAbsoluteURL
Returns `true` if the given string is an absolute URL, `false` otherwise.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,8 +6,7 @@ Use `String.replace` and a regular expression to add the character specified by
Omit the third parameter, `indent`, to use a default indentation character of `' '`.
```js
const indentString = (str, count, indent = ' ') =>
str.replace(/^/mg, indent.repeat(count));
const indentString = (str, count, indent = ' ') => str.replace(/^/gm, indent.repeat(count));
```
```js