Travis build: 505
This commit is contained in:
39
README.md
39
README.md
@ -20,8 +20,8 @@
|
|||||||
|
|
||||||
- [30 Seconds of CSS](https://30-seconds.github.io/30-seconds-of-css/)
|
- [30 Seconds of CSS](https://30-seconds.github.io/30-seconds-of-css/)
|
||||||
- [30 Seconds of Interviews](https://30secondsofinterviews.org/)
|
- [30 Seconds of Interviews](https://30secondsofinterviews.org/)
|
||||||
- [30 Seconds of Python](https://github.com/kriadmin/30-seconds-of-python-code) *unofficial*
|
- [30 Seconds of Python](https://github.com/kriadmin/30-seconds-of-python-code) *(unofficial)*
|
||||||
= [30 Seconds of PHP](https://github.com/appzcoder/30-seconds-of-php-code) *unofficial*
|
- [30 Seconds of PHP](https://github.com/appzcoder/30-seconds-of-php-code) *(unofficial)*
|
||||||
|
|
||||||
#### Package
|
#### Package
|
||||||
|
|
||||||
@ -491,15 +491,6 @@ average(1, 2, 3);
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Uncategorized
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>View contents</summary>
|
|
||||||
|
|
||||||
* [`pipeLog`](#pipelog)
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -9147,32 +9138,6 @@ yesNo('Foo', true); // true
|
|||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Uncategorized
|
|
||||||
|
|
||||||
### pipeLog
|
|
||||||
|
|
||||||
Use `console.log` in a pipeline as this function simply encloses it and returns the passed value. This is especially useful for debugging when you want to log a variable's value before its usage.
|
|
||||||
|
|
||||||
Logs a value and returns it.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const pipeLog = data => console.log(data) || data;
|
|
||||||
```
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Examples</summary>
|
|
||||||
|
|
||||||
```js
|
|
||||||
pipeLog(1); // logs `1` and returns `1`
|
|
||||||
```
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
|
||||||
|
|
||||||
|
|
||||||
## Collaborators
|
## Collaborators
|
||||||
|
|
||||||
| [<img src="https://github.com/Chalarangelo.png" width="100px;"/>](https://github.com/Chalarangelo)<br/> [<sub>Angelos Chalaris</sub>](https://github.com/Chalarangelo) | [<img src="https://github.com/flxwu.png" width="100px;"/>](https://github.com/flxwu)<br/> [<sub>Felix Wu</sub>](https://github.com/Pl4gue) | [<img src="https://github.com/fejes713.png" width="100px;"/>](https://github.com/fejes713)<br/> [<sub>Stefan Feješ</sub>](https://github.com/fejes713) | [<img src="https://github.com/kingdavidmartins.png" width="100px;"/>](https://github.com/kingdavidmartins)<br/> [<sub>King David Martins</sub>](https://github.com/iamsoorena) | [<img src="https://github.com/iamsoorena.png" width="100px;"/>](https://github.com/iamsoorena)<br/> [<sub>Soorena Soleimani</sub>](https://github.com/iamsoorena) |
|
| [<img src="https://github.com/Chalarangelo.png" width="100px;"/>](https://github.com/Chalarangelo)<br/> [<sub>Angelos Chalaris</sub>](https://github.com/Chalarangelo) | [<img src="https://github.com/flxwu.png" width="100px;"/>](https://github.com/flxwu)<br/> [<sub>Felix Wu</sub>](https://github.com/Pl4gue) | [<img src="https://github.com/fejes713.png" width="100px;"/>](https://github.com/fejes713)<br/> [<sub>Stefan Feješ</sub>](https://github.com/fejes713) | [<img src="https://github.com/kingdavidmartins.png" width="100px;"/>](https://github.com/kingdavidmartins)<br/> [<sub>King David Martins</sub>](https://github.com/iamsoorena) | [<img src="https://github.com/iamsoorena.png" width="100px;"/>](https://github.com/iamsoorena)<br/> [<sub>Soorena Soleimani</sub>](https://github.com/iamsoorena) |
|
||||||
|
|||||||
@ -40,8 +40,8 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://30-seconds.github.io/30-seconds-of-css/">30 seconds of CSS</a></li>
|
<li><a href="https://30-seconds.github.io/30-seconds-of-css/">30 seconds of CSS</a></li>
|
||||||
<li><a href="http://30secondsofinterviews.org/">30 seconds of Interviews</a> by <strong>fejes713</strong></li>
|
<li><a href="http://30secondsofinterviews.org/">30 seconds of Interviews</a> by <strong>fejes713</strong></li>
|
||||||
<li><a href="https://github.com/kriadmin/30-seconds-of-python-code">30 seconds of Python</a> <em>unofficial</em></li>
|
<li><a href="https://github.com/kriadmin/30-seconds-of-python-code">30 seconds of Python</a> <em>(unofficial)</em></li>
|
||||||
<li><a href="https://github.com/appzcoder/30-seconds-of-php-code">30 seconds of PHP</a> <em>unofficial</em></li>
|
<li><a href="https://github.com/appzcoder/30-seconds-of-php-code">30 seconds of PHP</a> <em>(unofficial)</em></li>
|
||||||
</ul><br />
|
</ul><br />
|
||||||
<h2 class="category-name">Maintainers</h2>
|
<h2 class="category-name">Maintainers</h2>
|
||||||
<div class="flex-row">
|
<div class="flex-row">
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -220,6 +220,8 @@
|
|||||||
</pre><label class="collapse">examples</label><pre class="section card-examples language-js"><span class="token function">levenshteinDistance</span><span class="token punctuation">(</span><span class="token string">'30-seconds-of-code'</span><span class="token punctuation">,</span><span class="token string">'30-seconds-of-python-code'</span><span class="token punctuation">);</span> <span class="token comment">// 7</span>
|
</pre><label class="collapse">examples</label><pre class="section card-examples language-js"><span class="token function">levenshteinDistance</span><span class="token punctuation">(</span><span class="token string">'30-seconds-of-code'</span><span class="token punctuation">,</span><span class="token string">'30-seconds-of-python-code'</span><span class="token punctuation">);</span> <span class="token comment">// 7</span>
|
||||||
<span class="token keyword">const</span> <span class="token function-variable function">compareStrings</span> <span class="token operator">=</span> <span class="token punctuation">(</span>string1<span class="token punctuation">,</span>string2<span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span><span class="token number">100</span> <span class="token operator">-</span> <span class="token function">levenshteinDistance</span><span class="token punctuation">(</span>string1<span class="token punctuation">,</span>string2<span class="token punctuation">)</span> <span class="token operator">/</span> Math<span class="token punctuation">.</span><span class="token function">max</span><span class="token punctuation">(</span>string1<span class="token punctuation">.</span>length<span class="token punctuation">,</span>string2<span class="token punctuation">.</span>length<span class="token punctuation">));</span>
|
<span class="token keyword">const</span> <span class="token function-variable function">compareStrings</span> <span class="token operator">=</span> <span class="token punctuation">(</span>string1<span class="token punctuation">,</span>string2<span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span><span class="token number">100</span> <span class="token operator">-</span> <span class="token function">levenshteinDistance</span><span class="token punctuation">(</span>string1<span class="token punctuation">,</span>string2<span class="token punctuation">)</span> <span class="token operator">/</span> Math<span class="token punctuation">.</span><span class="token function">max</span><span class="token punctuation">(</span>string1<span class="token punctuation">.</span>length<span class="token punctuation">,</span>string2<span class="token punctuation">.</span>length<span class="token punctuation">));</span>
|
||||||
<span class="token function">compareStrings</span><span class="token punctuation">(</span><span class="token string">'30-seconds-of-code'</span><span class="token punctuation">,</span> <span class="token string">'30-seconds-of-python-code'</span><span class="token punctuation">);</span> <span class="token comment">// 99.72 (%)</span>
|
<span class="token function">compareStrings</span><span class="token punctuation">(</span><span class="token string">'30-seconds-of-code'</span><span class="token punctuation">,</span> <span class="token string">'30-seconds-of-python-code'</span><span class="token punctuation">);</span> <span class="token comment">// 99.72 (%)</span>
|
||||||
|
</pre></div><div class="card code-card"><div class="section card-content"><h4 id="pipelog.md">pipeLog</h4><p>Logs a value and returns it.</p><p>Use <code>console.log</code> to log the supplied value, combined with the <code>||</code> operator to return it.</p></div><div class="copy-button-container"><button class="copy-button" aria-label="Copy to clipboard"></button></div><pre class="section card-code language-js"><span class="token keyword">const</span> <span class="token function-variable function">pipeLog</span> <span class="token operator">=</span> data <span class="token operator">=></span> console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>data<span class="token punctuation">)</span> <span class="token operator">||</span> data<span class="token punctuation">;</span>
|
||||||
|
</pre><label class="collapse">examples</label><pre class="section card-examples language-js"><span class="token function">pipeLog</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">);</span> <span class="token comment">// logs `1` and returns `1`</span>
|
||||||
</pre></div><div class="card code-card"><div class="section card-content"><h4 id="quicksort.md">quickSort</h4><p>QuickSort an Array (ascending sort by default).</p><p>Use recursion. Use <code>Array.filter</code> and spread operator (<code>...</code>) to create an array that all elements with values less than the pivot come before the pivot, and all elements with values greater than the pivot come after it. If the parameter <code>desc</code> is truthy, return array sorts in descending order.</p></div><div class="copy-button-container"><button class="copy-button" aria-label="Copy to clipboard"></button></div><pre class="section card-code language-js"><span class="token keyword">const</span> <span class="token function-variable function">quickSort</span> <span class="token operator">=</span> <span class="token punctuation">([</span>n<span class="token punctuation">,</span> <span class="token operator">...</span>nums<span class="token punctuation">],</span> desc<span class="token punctuation">)</span> <span class="token operator">=></span>
|
</pre></div><div class="card code-card"><div class="section card-content"><h4 id="quicksort.md">quickSort</h4><p>QuickSort an Array (ascending sort by default).</p><p>Use recursion. Use <code>Array.filter</code> and spread operator (<code>...</code>) to create an array that all elements with values less than the pivot come before the pivot, and all elements with values greater than the pivot come after it. If the parameter <code>desc</code> is truthy, return array sorts in descending order.</p></div><div class="copy-button-container"><button class="copy-button" aria-label="Copy to clipboard"></button></div><pre class="section card-code language-js"><span class="token keyword">const</span> <span class="token function-variable function">quickSort</span> <span class="token operator">=</span> <span class="token punctuation">([</span>n<span class="token punctuation">,</span> <span class="token operator">...</span>nums<span class="token punctuation">],</span> desc<span class="token punctuation">)</span> <span class="token operator">=></span>
|
||||||
<span class="token function">isNaN</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
|
<span class="token function">isNaN</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span>
|
||||||
<span class="token operator">?</span> <span class="token punctuation">[]
|
<span class="token operator">?</span> <span class="token punctuation">[]
|
||||||
|
|||||||
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
@ -209,7 +209,6 @@ pick:object,array,intermediate
|
|||||||
pickBy:object,array,function,intermediate
|
pickBy:object,array,function,intermediate
|
||||||
pipeAsyncFunctions:adapter,function,promise,intermediate
|
pipeAsyncFunctions:adapter,function,promise,intermediate
|
||||||
pipeFunctions:adapter,function,intermediate
|
pipeFunctions:adapter,function,intermediate
|
||||||
pipeLog:uncategorized
|
|
||||||
pluralize:string,intermediate
|
pluralize:string,intermediate
|
||||||
powerset:math,beginner
|
powerset:math,beginner
|
||||||
prefix:browser,utility,intermediate
|
prefix:browser,utility,intermediate
|
||||||
|
|||||||
Reference in New Issue
Block a user