Travis build: 142

This commit is contained in:
Travis CI
2017-12-22 18:00:48 +00:00
parent 345b53aae2
commit 86cb1e1296
2 changed files with 0 additions and 29 deletions

View File

@ -140,7 +140,6 @@
* [`reverseString`](#reversestring)
* [`sortCharactersInString`](#sortcharactersinstring)
* [`toCamelCase`](#tocamelcase)
* [`toSnakeCase`](#tosnakecase)
* [`truncateString`](#truncatestring)
* [`words`](#words)
@ -1912,23 +1911,6 @@ const toCamelCase = str =>
[⬆ back to top](#table-of-contents)
### toSnakeCase
Converts a string to snakecase.
Use `replace()` to add underscores before capital letters, convert `toLowerCase()`, then `replace()` hyphens and spaces with underscores.
```js
const toSnakeCase = str =>
str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-]/g, '_').toLowerCase();
// toSnakeCase("camelCase") -> 'camel_case'
// toSnakeCase("some text") -> 'some_text'
// toSnakeCase("some-javascript-property") -> 'some_javascript_property'
// toSnakeCase("some-mixed_string With spaces_underscores-and-hyphens") -> 'some_mixed_string_with_spaces_underscores_and_hyphens'
```
[⬆ back to top](#table-of-contents)
### truncateString
Truncates a string up to a specified length.

View File

@ -168,7 +168,6 @@
<a class="sublink-1" href="#reversestring">reverseString</a>
<a class="sublink-1" href="#sortcharactersinstring">sortCharactersInString</a>
<a class="sublink-1" href="#tocamelcase">toCamelCase</a>
<a class="sublink-1" href="#tosnakecase">toSnakeCase</a>
<a class="sublink-1" href="#truncatestring">truncateString</a>
<a class="sublink-1" href="#words">words</a>
@ -1179,16 +1178,6 @@ Combine characters to get a string using <code>join('')</code>.</p>
// toCamelCase(&quot;some-javascript-property&quot;) -&gt; 'someJavascriptProperty'
// toCamelCase(&quot;some-mixed_string with spaces_underscores-and-hyphens&quot;) -&gt; 'someMixedStringWithSpacesUnderscoresAndHyphens'
</code></pre>
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="tosnakecase">toSnakeCase</h3></div><div class="section double-padded">
<p>Converts a string to snakecase.</p>
<p>Use <code>replace()</code> to add underscores before capital letters, convert <code>toLowerCase()</code>, then <code>replace()</code> hyphens and spaces with underscores.</p>
<pre><code class="language-js">const toSnakeCase = str =&gt;
str.replace(/(\w)([A-Z])/g, '$1_$2').replace(/[\s-]/g, '_').toLowerCase();
// toSnakeCase(&quot;camelCase&quot;) -&gt; 'camel_case'
// toSnakeCase(&quot;some text&quot;) -&gt; 'some_text'
// toSnakeCase(&quot;some-javascript-property&quot;) -&gt; 'some_javascript_property'
// toSnakeCase(&quot;some-mixed_string With spaces_underscores-and-hyphens&quot;) -&gt; 'some_mixed_string_with_spaces_underscores_and_hyphens'
</code></pre>
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="truncatestring">truncateString</h3></div><div class="section double-padded">
<p>Truncates a string up to a specified length.</p>
<p>Determine if the string's <code>length</code> is greater than <code>num</code>.