Minified index
This commit is contained in:
@ -149,4 +149,4 @@ Object<span class="token punctuation">.</span><span class="token function">assig
|
|||||||
<span class="token function">arrayMax</span><span class="token punctuation">([</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">]);</span> <span class="token comment">// 3</span>
|
<span class="token function">arrayMax</span><span class="token punctuation">([</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">]);</span> <span class="token comment">// 3</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><div class="card fluid"><h3 id="unary" class="section double-padded">unary</h3><div class="section double-padded"><p>Creates a function that accepts up to one argument, ignoring any additional arguments.</p><p>Call the provided function, <code>fn</code>, with just the first argument given.</p><pre class="language-js"><span class="token keyword">const</span> <span class="token function-variable function">unary</span> <span class="token operator">=</span> fn <span class="token operator">=></span> val <span class="token operator">=></span> <span class="token function">fn</span><span class="token punctuation">(</span>val<span class="token punctuation">);</span>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><div class="card fluid"><h3 id="unary" class="section double-padded">unary</h3><div class="section double-padded"><p>Creates a function that accepts up to one argument, ignoring any additional arguments.</p><p>Call the provided function, <code>fn</code>, with just the first argument given.</p><pre class="language-js"><span class="token keyword">const</span> <span class="token function-variable function">unary</span> <span class="token operator">=</span> fn <span class="token operator">=></span> val <span class="token operator">=></span> <span class="token function">fn</span><span class="token punctuation">(</span>val<span class="token punctuation">);</span>
|
||||||
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token punctuation">[</span><span class="token string">'6'</span><span class="token punctuation">,</span> <span class="token string">'8'</span><span class="token punctuation">,</span> <span class="token string">'10'</span><span class="token punctuation">].</span><span class="token function">map</span><span class="token punctuation">(</span><span class="token function">unary</span><span class="token punctuation">(</span>parseInt<span class="token punctuation">));</span> <span class="token comment">// [6, 8, 10]</span>
|
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token punctuation">[</span><span class="token string">'6'</span><span class="token punctuation">,</span> <span class="token string">'8'</span><span class="token punctuation">,</span> <span class="token string">'10'</span><span class="token punctuation">].</span><span class="token function">map</span><span class="token punctuation">(</span><span class="token function">unary</span><span class="token punctuation">(</span>parseInt<span class="token punctuation">));</span> <span class="token comment">// [6, 8, 10]</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
||||||
@ -239,4 +239,4 @@
|
|||||||
window<span class="token punctuation">.</span>speechSynthesis<span class="token punctuation">.</span><span class="token function">speak</span><span class="token punctuation">(</span>msg<span class="token punctuation">);
|
window<span class="token punctuation">.</span>speechSynthesis<span class="token punctuation">.</span><span class="token function">speak</span><span class="token punctuation">(</span>msg<span class="token punctuation">);
|
||||||
};</span>
|
};</span>
|
||||||
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">speechSynthesis</span><span class="token punctuation">(</span><span class="token string">'Hello, World'</span><span class="token punctuation">);</span> <span class="token comment">// // plays the message</span>
|
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">speechSynthesis</span><span class="token punctuation">(</span><span class="token string">'Hello, World'</span><span class="token punctuation">);</span> <span class="token comment">// // plays the message</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div></div></div></div><button class="scroll-to-top">↑</button><br/><footer class="container"><div class="row"><div class="col-sm-12 col-md-10 col-lg-8 col-md-offset-1 col-lg-offset-2"><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></div></div></footer></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div></div></div></div><button class="scroll-to-top">↑</button><br/><footer class="container"><div class="row"><div class="col-sm-12 col-md-10 col-lg-8 col-md-offset-1 col-lg-offset-2"><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></div></div></footer></body></html>
|
||||||
@ -518,4 +518,4 @@
|
|||||||
[</span><span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">200</span><span class="token punctuation">],
|
[</span><span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">200</span><span class="token punctuation">],
|
||||||
(</span>a<span class="token punctuation">,</span> b<span class="token punctuation">,</span> c<span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span>a <span class="token operator">!=</span> <span class="token keyword">null</span> <span class="token operator">?</span> a <span class="token punctuation">:</span> <span class="token string">'a'</span><span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token punctuation">(</span>b <span class="token operator">!=</span> <span class="token keyword">null</span> <span class="token operator">?</span> b <span class="token punctuation">:</span> <span class="token string">'b'</span><span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token punctuation">(</span>c <span class="token operator">!=</span> <span class="token keyword">null</span> <span class="token operator">?</span> c <span class="token punctuation">:</span> <span class="token string">'c'</span><span class="token punctuation">)
|
(</span>a<span class="token punctuation">,</span> b<span class="token punctuation">,</span> c<span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span>a <span class="token operator">!=</span> <span class="token keyword">null</span> <span class="token operator">?</span> a <span class="token punctuation">:</span> <span class="token string">'a'</span><span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token punctuation">(</span>b <span class="token operator">!=</span> <span class="token keyword">null</span> <span class="token operator">?</span> b <span class="token punctuation">:</span> <span class="token string">'b'</span><span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token punctuation">(</span>c <span class="token operator">!=</span> <span class="token keyword">null</span> <span class="token operator">?</span> c <span class="token punctuation">:</span> <span class="token string">'c'</span><span class="token punctuation">)
|
||||||
);</span> <span class="token comment">// [111, 222, '3bc']</span>
|
);</span> <span class="token comment">// [111, 222, '3bc']</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
||||||
@ -135,4 +135,4 @@
|
|||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div></div></div><div class="row"><div class="col-sm-12 col-md-10 col-lg-8 col-md-offset-1 col-lg-offset-2"><div class="card fluid"><h3 id="truncatestring.md" class="section double-padded">truncateString</h3><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>. Return the string truncated to the desired length, with <code>'...'</code> appended to the end or the original string.</p><pre class="language-js"><span class="token keyword">const</span> <span class="token function-variable function">truncateString</span> <span class="token operator">=</span> <span class="token punctuation">(</span>str<span class="token punctuation">,</span> num<span class="token punctuation">)</span> <span class="token operator">=></span>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div></div></div><div class="row"><div class="col-sm-12 col-md-10 col-lg-8 col-md-offset-1 col-lg-offset-2"><div class="card fluid"><h3 id="truncatestring.md" class="section double-padded">truncateString</h3><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>. Return the string truncated to the desired length, with <code>'...'</code> appended to the end or the original string.</p><pre class="language-js"><span class="token keyword">const</span> <span class="token function-variable function">truncateString</span> <span class="token operator">=</span> <span class="token punctuation">(</span>str<span class="token punctuation">,</span> num<span class="token punctuation">)</span> <span class="token operator">=></span>
|
||||||
str<span class="token punctuation">.</span>length <span class="token operator">></span> num <span class="token operator">?</span> str<span class="token punctuation">.</span><span class="token function">slice</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> num <span class="token operator">></span> <span class="token number">3</span> <span class="token operator">?</span> num <span class="token operator">-</span> <span class="token number">3</span> <span class="token punctuation">:</span> num<span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token string">'...'</span> <span class="token punctuation">:</span> str<span class="token punctuation">;</span>
|
str<span class="token punctuation">.</span>length <span class="token operator">></span> num <span class="token operator">?</span> str<span class="token punctuation">.</span><span class="token function">slice</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> num <span class="token operator">></span> <span class="token number">3</span> <span class="token operator">?</span> num <span class="token operator">-</span> <span class="token number">3</span> <span class="token punctuation">:</span> num<span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token string">'...'</span> <span class="token punctuation">:</span> str<span class="token punctuation">;</span>
|
||||||
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">truncateString</span><span class="token punctuation">(</span><span class="token string">'boomerang'</span><span class="token punctuation">,</span> <span class="token number">7</span><span class="token punctuation">);</span> <span class="token comment">// 'boom...'</span>
|
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">truncateString</span><span class="token punctuation">(</span><span class="token string">'boomerang'</span><span class="token punctuation">,</span> <span class="token number">7</span><span class="token punctuation">);</span> <span class="token comment">// 'boom...'</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div></div></div></div><button class="scroll-to-top">↑</button><br/><footer class="container"><div class="row"><div class="col-sm-12 col-md-10 col-lg-8 col-md-offset-1 col-lg-offset-2"><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></div></div></footer></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div></div></div></div><button class="scroll-to-top">↑</button><br/><footer class="container"><div class="row"><div class="col-sm-12 col-md-10 col-lg-8 col-md-offset-1 col-lg-offset-2"><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></div></div></footer></body></html>
|
||||||
@ -331,4 +331,4 @@ recorder<span class="token punctuation">.</span><span class="token function">sta
|
|||||||
<span class="token punctuation">(</span>c <span class="token operator">^</span> <span class="token punctuation">(</span>crypto<span class="token punctuation">.</span><span class="token function">getRandomValues</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Uint8Array</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">))[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">&</span> <span class="token punctuation">(</span><span class="token number">15</span> <span class="token operator">>></span> <span class="token punctuation">(</span>c <span class="token operator">/</span> <span class="token number">4</span><span class="token punctuation">)))).</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token number">16</span><span class="token punctuation">)
|
<span class="token punctuation">(</span>c <span class="token operator">^</span> <span class="token punctuation">(</span>crypto<span class="token punctuation">.</span><span class="token function">getRandomValues</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Uint8Array</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">))[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">&</span> <span class="token punctuation">(</span><span class="token number">15</span> <span class="token operator">>></span> <span class="token punctuation">(</span>c <span class="token operator">/</span> <span class="token number">4</span><span class="token punctuation">)))).</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token number">16</span><span class="token punctuation">)
|
||||||
);</span>
|
);</span>
|
||||||
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">UUIDGeneratorBrowser</span><span class="token punctuation">();</span> <span class="token comment">// '7982fcfe-5721-4632-bede-6000885be57d'</span>
|
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">UUIDGeneratorBrowser</span><span class="token punctuation">();</span> <span class="token comment">// '7982fcfe-5721-4632-bede-6000885be57d'</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
||||||
@ -115,4 +115,4 @@
|
|||||||
};</span>
|
};</span>
|
||||||
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">tomorrow</span><span class="token punctuation">();</span> <span class="token comment">// 2017-12-27 (if current date is 2017-12-26)</span>
|
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">tomorrow</span><span class="token punctuation">();</span> <span class="token comment">// 2017-12-27 (if current date is 2017-12-26)</span>
|
||||||
<span class="token function">tomorrow</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">);</span> <span class="token comment">// 2017-12-27T00:00:00 (if current date is 2017-12-26)</span>
|
<span class="token function">tomorrow</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">);</span> <span class="token comment">// 2017-12-27T00:00:00 (if current date is 2017-12-26)</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
||||||
@ -269,4 +269,4 @@ console<span class="token punctuation">.</span><span class="token function">log<
|
|||||||
};</span>
|
};</span>
|
||||||
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token keyword">var</span> <span class="token function-variable function">f</span> <span class="token operator">=</span> n <span class="token operator">=></span> <span class="token punctuation">(</span>n <span class="token operator">></span> <span class="token number">50</span> <span class="token operator">?</span> <span class="token boolean">false</span> <span class="token punctuation">: [</span><span class="token operator">-</span>n<span class="token punctuation">,</span> n <span class="token operator">+</span> <span class="token number">10</span><span class="token punctuation">]);</span>
|
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token keyword">var</span> <span class="token function-variable function">f</span> <span class="token operator">=</span> n <span class="token operator">=></span> <span class="token punctuation">(</span>n <span class="token operator">></span> <span class="token number">50</span> <span class="token operator">?</span> <span class="token boolean">false</span> <span class="token punctuation">: [</span><span class="token operator">-</span>n<span class="token punctuation">,</span> n <span class="token operator">+</span> <span class="token number">10</span><span class="token punctuation">]);</span>
|
||||||
<span class="token function">unfold</span><span class="token punctuation">(</span>f<span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">);</span> <span class="token comment">// [-10, -20, -30, -40, -50]</span>
|
<span class="token function">unfold</span><span class="token punctuation">(</span>f<span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">);</span> <span class="token comment">// [-10, -20, -30, -40, -50]</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
||||||
290
docs/index.html
290
docs/index.html
File diff suppressed because one or more lines are too long
@ -272,4 +272,4 @@ own individual rating by supplying it as the third argument.
|
|||||||
Math<span class="token punctuation">.</span><span class="token function">round</span><span class="token punctuation">(</span>Math<span class="token punctuation">.</span><span class="token function">max</span><span class="token punctuation">(</span>Math<span class="token punctuation">.</span><span class="token function">min</span><span class="token punctuation">(</span>num<span class="token punctuation">,</span> Number<span class="token punctuation">.</span>MAX_SAFE_INTEGER<span class="token punctuation">),</span> Number<span class="token punctuation">.</span>MIN_SAFE_INTEGER<span class="token punctuation">));</span>
|
Math<span class="token punctuation">.</span><span class="token function">round</span><span class="token punctuation">(</span>Math<span class="token punctuation">.</span><span class="token function">max</span><span class="token punctuation">(</span>Math<span class="token punctuation">.</span><span class="token function">min</span><span class="token punctuation">(</span>num<span class="token punctuation">,</span> Number<span class="token punctuation">.</span>MAX_SAFE_INTEGER<span class="token punctuation">),</span> Number<span class="token punctuation">.</span>MIN_SAFE_INTEGER<span class="token punctuation">));</span>
|
||||||
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">toSafeInteger</span><span class="token punctuation">(</span><span class="token string">'3.2'</span><span class="token punctuation">);</span> <span class="token comment">// 3</span>
|
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">toSafeInteger</span><span class="token punctuation">(</span><span class="token string">'3.2'</span><span class="token punctuation">);</span> <span class="token comment">// 3</span>
|
||||||
<span class="token function">toSafeInteger</span><span class="token punctuation">(</span><span class="token number">Infinity</span><span class="token punctuation">);</span> <span class="token comment">// 9007199254740991</span>
|
<span class="token function">toSafeInteger</span><span class="token punctuation">(</span><span class="token number">Infinity</span><span class="token punctuation">);</span> <span class="token comment">// 9007199254740991</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
||||||
@ -151,4 +151,4 @@ console<span class="token punctuation">.</span><span class="token function">log<
|
|||||||
<span class="token punctuation">(</span>c <span class="token operator">^</span> <span class="token punctuation">(</span>crypto<span class="token punctuation">.</span><span class="token function">randomBytes</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">&</span> <span class="token punctuation">(</span><span class="token number">15</span> <span class="token operator">>></span> <span class="token punctuation">(</span>c <span class="token operator">/</span> <span class="token number">4</span><span class="token punctuation">)))).</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token number">16</span><span class="token punctuation">)
|
<span class="token punctuation">(</span>c <span class="token operator">^</span> <span class="token punctuation">(</span>crypto<span class="token punctuation">.</span><span class="token function">randomBytes</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">&</span> <span class="token punctuation">(</span><span class="token number">15</span> <span class="token operator">>></span> <span class="token punctuation">(</span>c <span class="token operator">/</span> <span class="token number">4</span><span class="token punctuation">)))).</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token number">16</span><span class="token punctuation">)
|
||||||
);</span>
|
);</span>
|
||||||
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">UUIDGeneratorNode</span><span class="token punctuation">();</span> <span class="token comment">// '79c7c136-60ee-40a2-beb2-856f1feabefc'</span>
|
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">UUIDGeneratorNode</span><span class="token punctuation">();</span> <span class="token comment">// '79c7c136-60ee-40a2-beb2-856f1feabefc'</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
||||||
@ -329,4 +329,4 @@ Foo<span class="token punctuation">.</span>prototype<span class="token punctuati
|
|||||||
<span class="token keyword">return</span> acc<span class="token punctuation">;
|
<span class="token keyword">return</span> acc<span class="token punctuation">;
|
||||||
}, {});</span>
|
}, {});</span>
|
||||||
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">unflattenObject</span><span class="token punctuation">({</span> <span class="token string">'a.b.c'</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span> d<span class="token punctuation">:</span> <span class="token number">1</span> <span class="token punctuation">});</span> <span class="token comment">// { a: { b: { c: 1 } }, d: 1 }</span>
|
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">unflattenObject</span><span class="token punctuation">({</span> <span class="token string">'a.b.c'</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span> d<span class="token punctuation">:</span> <span class="token number">1</span> <span class="token punctuation">});</span> <span class="token comment">// { a: { b: { c: 1 } }, d: 1 }</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
||||||
@ -258,4 +258,4 @@
|
|||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><div class="card fluid"><h3 id="words" class="section double-padded">words</h3><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 regexp) 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 regexp.</p><pre class="language-js"><span class="token keyword">const</span> words <span class="token operator">=</span> <span class="token punctuation">(</span>str<span class="token punctuation">,</span> pattern <span class="token operator">=</span> <span class="token regex">/[^a-zA-Z-]+/</span><span class="token punctuation">)</span> <span class="token operator">=></span> str<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span>pattern<span class="token punctuation">).</span><span class="token function">filter</span><span class="token punctuation">(</span>Boolean<span class="token punctuation">);</span>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><div class="card fluid"><h3 id="words" class="section double-padded">words</h3><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 regexp) 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 regexp.</p><pre class="language-js"><span class="token keyword">const</span> words <span class="token operator">=</span> <span class="token punctuation">(</span>str<span class="token punctuation">,</span> pattern <span class="token operator">=</span> <span class="token regex">/[^a-zA-Z-]+/</span><span class="token punctuation">)</span> <span class="token operator">=></span> str<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span>pattern<span class="token punctuation">).</span><span class="token function">filter</span><span class="token punctuation">(</span>Boolean<span class="token punctuation">);</span>
|
||||||
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">words</span><span class="token punctuation">(</span><span class="token string">'I love javaScript!!'</span><span class="token punctuation">);</span> <span class="token comment">// ["I", "love", "javaScript"]</span>
|
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">words</span><span class="token punctuation">(</span><span class="token string">'I love javaScript!!'</span><span class="token punctuation">);</span> <span class="token comment">// ["I", "love", "javaScript"]</span>
|
||||||
<span class="token function">words</span><span class="token punctuation">(</span><span class="token string">'python, javaScript & coffee'</span><span class="token punctuation">);</span> <span class="token comment">// ["python", "javaScript", "coffee"]</span>
|
<span class="token function">words</span><span class="token punctuation">(</span><span class="token string">'python, javaScript & coffee'</span><span class="token punctuation">);</span> <span class="token comment">// ["python", "javaScript", "coffee"]</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
||||||
@ -178,4 +178,4 @@
|
|||||||
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">isValidJSON</span><span class="token punctuation">(</span><span class="token string">'{"name":"Adam","age":20}'</span><span class="token punctuation">);</span> <span class="token comment">// true</span>
|
</pre><label class="collapse">Show examples</label><pre class="language-js"><span class="token function">isValidJSON</span><span class="token punctuation">(</span><span class="token string">'{"name":"Adam","age":20}'</span><span class="token punctuation">);</span> <span class="token comment">// true</span>
|
||||||
<span class="token function">isValidJSON</span><span class="token punctuation">(</span><span class="token string">'{"name":"Adam",age:"20"}'</span><span class="token punctuation">);</span> <span class="token comment">// false</span>
|
<span class="token function">isValidJSON</span><span class="token punctuation">(</span><span class="token string">'{"name":"Adam",age:"20"}'</span><span class="token punctuation">);</span> <span class="token comment">// false</span>
|
||||||
<span class="token function">isValidJSON</span><span class="token punctuation">(</span><span class="token keyword">null</span><span class="token punctuation">);</span> <span class="token comment">// true</span>
|
<span class="token function">isValidJSON</span><span class="token punctuation">(</span><span class="token keyword">null</span><span class="token punctuation">);</span> <span class="token comment">// true</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
||||||
@ -269,4 +269,4 @@ Logs: {
|
|||||||
<span class="token function">yesNo</span><span class="token punctuation">(</span><span class="token string">'yes'</span><span class="token punctuation">);</span> <span class="token comment">// true</span>
|
<span class="token function">yesNo</span><span class="token punctuation">(</span><span class="token string">'yes'</span><span class="token punctuation">);</span> <span class="token comment">// true</span>
|
||||||
<span class="token function">yesNo</span><span class="token punctuation">(</span><span class="token string">'No'</span><span class="token punctuation">);</span> <span class="token comment">// false</span>
|
<span class="token function">yesNo</span><span class="token punctuation">(</span><span class="token string">'No'</span><span class="token punctuation">);</span> <span class="token comment">// false</span>
|
||||||
<span class="token function">yesNo</span><span class="token punctuation">(</span><span class="token string">'Foo'</span><span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">);</span> <span class="token comment">// true</span>
|
<span class="token function">yesNo</span><span class="token punctuation">(</span><span class="token string">'Foo'</span><span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">);</span> <span class="token comment">// true</span>
|
||||||
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
</pre><button class="primary clipboard-copy">📋 Copy to clipboard</button></div></div><button class="scroll-to-top">↑</button><footer><p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> are licensed under the <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a> license.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed under the <a href="https://opensource.org/licenses/MIT">MIT</a> license.<br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer></main></div></body></html>
|
||||||
@ -149,6 +149,22 @@ if(!util.isTravisCI() || (util.isTravisCI() && (process.env['TRAVIS_EVENT_TYPE']
|
|||||||
contribs = resContributors.headers.link.split('&').slice(-1)[0].replace(/[^\d]/g,''),
|
contribs = resContributors.headers.link.split('&').slice(-1)[0].replace(/[^\d]/g,''),
|
||||||
stars = resStars.headers.link.split('&').slice(-1)[0].replace(/[^\d]/g,'');
|
stars = resStars.headers.link.split('&').slice(-1)[0].replace(/[^\d]/g,'');
|
||||||
indexStaticFile = indexStaticFile.replace(/\$snippet-count/g, Object.keys(snippets).length).replace(/\$commit-count/g,commits).replace(/\$contrib-count/g,contribs).replace(/\$star-count/g,stars);
|
indexStaticFile = indexStaticFile.replace(/\$snippet-count/g, Object.keys(snippets).length).replace(/\$commit-count/g,commits).replace(/\$contrib-count/g,contribs).replace(/\$star-count/g,stars);
|
||||||
|
indexStaticFile = minify(indexStaticFile, {
|
||||||
|
collapseBooleanAttributes: true,
|
||||||
|
collapseWhitespace: true,
|
||||||
|
decodeEntities: false,
|
||||||
|
minifyCSS: true,
|
||||||
|
minifyJS: true,
|
||||||
|
keepClosingSlash: true,
|
||||||
|
processConditionalComments: true,
|
||||||
|
removeAttributeQuotes: false,
|
||||||
|
removeComments: true,
|
||||||
|
removeEmptyAttributes: false,
|
||||||
|
removeOptionalTags: false,
|
||||||
|
removeScriptTypeAttributes: false,
|
||||||
|
removeStyleLinkTypeAttributes: false,
|
||||||
|
trimCustomFragments: true
|
||||||
|
});
|
||||||
// Generate 'index.html' file
|
// Generate 'index.html' file
|
||||||
fs.writeFileSync(path.join(docsPath, 'index.html'), indexStaticFile);
|
fs.writeFileSync(path.join(docsPath, 'index.html'), indexStaticFile);
|
||||||
console.log(`${chalk.green('SUCCESS!')} index.html file generated!`);
|
console.log(`${chalk.green('SUCCESS!')} index.html file generated!`);
|
||||||
|
|||||||
@ -109,36 +109,36 @@
|
|||||||
<h2 class="index-section">Top contributors</h2>
|
<h2 class="index-section">Top contributors</h2>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
||||||
<img class="section media" src="https://github.com/Chalarangelo.png"/ alt="chalarangelo">
|
<img class="section media" src="https://github.com/Chalarangelo.png" alt="chalarangelo"/>
|
||||||
<a href="https://github.com/Chalarangelo" class="section button">Angelos Chalaris</a>
|
<a href="https://github.com/Chalarangelo" class="section button">Angelos Chalaris</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
||||||
<img class="section media" src="https://github.com/fejes713.png"/ alt="fejes713">
|
<img class="section media" src="https://github.com/fejes713.png" alt="fejes713"/>
|
||||||
<a href="https://github.com/fejes713" class="section button">Stefan Feješ</a>
|
<a href="https://github.com/fejes713" class="section button">Stefan Feješ</a>
|
||||||
</div></div>
|
</div></div>
|
||||||
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
||||||
<img class="section media" src="https://github.com/flxwu.png"/ alt="flxwu">
|
<img class="section media" src="https://github.com/flxwu.png" alt="flxwu"/>
|
||||||
<a href="https://github.com/flxwu" class="section button">Felix Wu</a>
|
<a href="https://github.com/flxwu" class="section button">Felix Wu</a>
|
||||||
</div></div>
|
</div></div>
|
||||||
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
||||||
<img class="section media" src="https://github.com/atomiks.png"/ alt="atomiks">
|
<img class="section media" src="https://github.com/atomiks.png" alt="atomiks"/>
|
||||||
<a href="https://github.com/atomiks" class="section button">atomiks</a>
|
<a href="https://github.com/atomiks" class="section button">atomiks</a>
|
||||||
</div></div>
|
</div></div>
|
||||||
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
||||||
<img class="section media" src="https://github.com/kingdavidmartins.png"/ alt="kingdavidmartins">
|
<img class="section media" src="https://github.com/kingdavidmartins.png" alt="kingdavidmartins"/>
|
||||||
<a href="https://github.com/kingdavidmartins" class="section button">King David Martins</a>
|
<a href="https://github.com/kingdavidmartins" class="section button">King David Martins</a>
|
||||||
</div></div>
|
</div></div>
|
||||||
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
||||||
<img class="section media" src="https://github.com/kriadmin.png"/ alt="kriadmin">
|
<img class="section media" src="https://github.com/kriadmin.png" alt="kriadmin"/>
|
||||||
<a href="https://github.com/kriadmin" class="section button">Rohit Tanwar</a>
|
<a href="https://github.com/kriadmin" class="section button">Rohit Tanwar</a>
|
||||||
</div></div>
|
</div></div>
|
||||||
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
||||||
<img class="section media" src="https://github.com/iamsoorena.png"/ alt="iamsoorena">
|
<img class="section media" src="https://github.com/iamsoorena.png" alt="iamsoorena"/>
|
||||||
<a href="https://github.com/iamsoorena" class="section button">Soorena Soleimani</a>
|
<a href="https://github.com/iamsoorena" class="section button">Soorena Soleimani</a>
|
||||||
</div></div>
|
</div></div>
|
||||||
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
<div class="col-sm-6 col-md-3 col-lg no-padding"><div class="card fluid contributor">
|
||||||
<img class="section media" src="https://github.com/skatcat31.png"/ alt="skatcat31">
|
<img class="section media" src="https://github.com/skatcat31.png" alt="skatcat31"/>
|
||||||
<a href="https://github.com/skatcat31" class="section button">Robert Mennell</a>
|
<a href="https://github.com/skatcat31" class="section button">Robert Mennell</a>
|
||||||
</div></div>
|
</div></div>
|
||||||
</div>
|
</div>
|
||||||
@ -199,7 +199,7 @@ window.onload = function(){
|
|||||||
runCounter(counters[1],0,values[1],steps[1]);
|
runCounter(counters[1],0,values[1],steps[1]);
|
||||||
runCounter(counters[2],0,values[2],steps[2]);
|
runCounter(counters[2],0,values[2],steps[2]);
|
||||||
runCounter(counters[3],0,values[3],steps[3]);
|
runCounter(counters[3],0,values[3],steps[3]);
|
||||||
document.querySelector('button.next').addEventListener('click', e => {
|
document.querySelector('button.next').addEventListener('click', function(e){
|
||||||
let selected = document.getElementById('pick-slider').querySelector('.selected');
|
let selected = document.getElementById('pick-slider').querySelector('.selected');
|
||||||
if(selected == Array.from(document.querySelectorAll('.card.fluid.pick')).slice(-1)[0])
|
if(selected == Array.from(document.querySelectorAll('.card.fluid.pick')).slice(-1)[0])
|
||||||
{
|
{
|
||||||
@ -211,7 +211,7 @@ window.onload = function(){
|
|||||||
selected.className = 'card fluid pick';
|
selected.className = 'card fluid pick';
|
||||||
});
|
});
|
||||||
|
|
||||||
document.querySelector('button.previous').addEventListener('click', e => {
|
document.querySelector('button.previous').addEventListener('click', function(e){
|
||||||
let selected = document.getElementById('pick-slider').querySelector('.selected');
|
let selected = document.getElementById('pick-slider').querySelector('.selected');
|
||||||
if(selected == document.querySelector('.card.fluid.pick'))
|
if(selected == document.querySelector('.card.fluid.pick'))
|
||||||
{
|
{
|
||||||
@ -248,7 +248,7 @@ window.onload = function(){
|
|||||||
|
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
const runCounter = (selector, start, end, increment = 1, duration = 2000) => {
|
function runCounter(selector, start, end, increment = 1, duration = 2000){
|
||||||
let current = start,
|
let current = start,
|
||||||
step = end > start ? increment : -increment,
|
step = end > start ? increment : -increment,
|
||||||
timer = setInterval(function() {
|
timer = setInterval(function() {
|
||||||
@ -259,7 +259,7 @@ const runCounter = (selector, start, end, increment = 1, duration = 2000) => {
|
|||||||
}, Math.abs(Math.floor(duration / (end - start))));
|
}, Math.abs(Math.floor(duration / (end - start))));
|
||||||
};
|
};
|
||||||
|
|
||||||
const elementIsVisibleInViewport = (el, partiallyVisible = false) => {
|
function elementIsVisibleInViewport(el, partiallyVisible = false) {
|
||||||
const { top, left, bottom, right } = el.getBoundingClientRect();
|
const { top, left, bottom, right } = el.getBoundingClientRect();
|
||||||
const { innerHeight, innerWidth } = window;
|
const { innerHeight, innerWidth } = window;
|
||||||
return partiallyVisible
|
return partiallyVisible
|
||||||
|
|||||||
Reference in New Issue
Block a user