Travis build: 15
This commit is contained in:
@ -163,9 +163,9 @@
|
|||||||
<a class="sublink-1" href="#fromcamelcase">fromCamelCase</a>
|
<a class="sublink-1" href="#fromcamelcase">fromCamelCase</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="#stringtoarrayofwords">stringToArrayOfWords</a>
|
|
||||||
<a class="sublink-1" href="#tocamelcase">toCamelCase</a>
|
<a class="sublink-1" href="#tocamelcase">toCamelCase</a>
|
||||||
<a class="sublink-1" href="#truncatestring">truncateString</a>
|
<a class="sublink-1" href="#truncatestring">truncateString</a>
|
||||||
|
<a class="sublink-1" href="#words">words</a>
|
||||||
|
|
||||||
<h3>Utility
|
<h3>Utility
|
||||||
</h3><a class="sublink-1" href="#coalesce">coalesce</a>
|
</h3><a class="sublink-1" href="#coalesce">coalesce</a>
|
||||||
@ -1137,14 +1137,6 @@ Combine characters to get a string using <code>join('')</code>.</p>
|
|||||||
str.split('').sort((a, b) => a.localeCompare(b)).join('');
|
str.split('').sort((a, b) => a.localeCompare(b)).join('');
|
||||||
// sortCharactersInString('cabbage') -> 'aabbceg'
|
// sortCharactersInString('cabbage') -> 'aabbceg'
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="stringtoarrayofwords">stringToArrayOfWords</h3></div><div class="section double-padded">
|
|
||||||
<p>Converts a given string into an array of words.</p>
|
|
||||||
<p>Use <code>String.split()</code> with a supplied pattern (defaults to non alpha as a regex) to convert to an array of strings. Use <code>Array.filter()</code> to remove any empty strings.
|
|
||||||
Omit the second argument to use the default regex.</p>
|
|
||||||
<pre><code class="language-js">const stringToArrayOfWords = (str, pattern = /[^a-zA-Z-]+/) => str.split(pattern).filter(Boolean);
|
|
||||||
// stringToArrayOfWords("I love javaScript!!") -> ["I", "love", "javaScript"]
|
|
||||||
// stringToArrayOfWords("python, javaScript & coffee") -> ["python", "javaScript", "coffee"]
|
|
||||||
</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>Use <code>replace()</code> to remove underscores, hyphens and spaces and convert words to camelcase.</p>
|
<p>Use <code>replace()</code> to remove underscores, hyphens and spaces and convert words to camelcase.</p>
|
||||||
@ -1163,6 +1155,14 @@ Return the string truncated to the desired length, with <code>...</code> appende
|
|||||||
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
|
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
|
||||||
// truncateString('boomerang', 7) -> 'boom...'
|
// truncateString('boomerang', 7) -> 'boom...'
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="words">words</h3></div><div class="section double-padded">
|
||||||
|
<p>Converts a given string into an array of words.</p>
|
||||||
|
<p>Use <code>String.split()</code> with a supplied pattern (defaults to non alpha as a regex) to convert to an array of strings. Use <code>Array.filter()</code> to remove any empty strings.
|
||||||
|
Omit the second argument to use the default regex.</p>
|
||||||
|
<pre><code class="language-js">const words = (str, pattern = /[^a-zA-Z-]+/) => str.split(pattern).filter(Boolean);
|
||||||
|
// words("I love javaScript!!") -> ["I", "love", "javaScript"]
|
||||||
|
// words("python, javaScript & coffee") -> ["python", "javaScript", "coffee"]
|
||||||
|
</code></pre>
|
||||||
</div></div><br/><h2 style="text-align:center">Utility</h2>
|
</div></div><br/><h2 style="text-align:center">Utility</h2>
|
||||||
<div class="card fluid"><div class="section double-padded"><h3 id="coalesce">coalesce</h3></div><div class="section double-padded">
|
<div class="card fluid"><div class="section double-padded"><h3 id="coalesce">coalesce</h3></div><div class="section double-padded">
|
||||||
<p>Returns the first non-null/undefined argument.</p>
|
<p>Returns the first non-null/undefined argument.</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user