Travis build: 114

This commit is contained in:
Travis CI
2017-12-22 14:11:44 +00:00
parent 0752a61b01
commit 10c2adc83d
3 changed files with 44 additions and 1 deletions

View File

@ -161,6 +161,9 @@
* [`UUIDGenerator`](#uuidgenerator) * [`UUIDGenerator`](#uuidgenerator)
* [`validateNumber`](#validatenumber) * [`validateNumber`](#validatenumber)
### _Uncategorized_
* [`flip`](#flip)
## Adapter ## Adapter
### spreadOver ### spreadOver
@ -2203,6 +2206,28 @@ const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) ==
// validateNumber('10') -> true // validateNumber('10') -> true
``` ```
[⬆ back to top](#table-of-contents)
## _Uncategorized_
### flip
Flip takes a function as an argument, then makes the first argument the last
Return a closure that takes variadic inputs, and splices the last argument to make it the first argument before applying the rest.
```js
const flip = fn => (...args) => fn(args.pop(), ...args)
/*
let a = {name: 'John Smith'}
let b = {}
const mergeFrom = flip(Object.assign)
let mergePerson = mergeFrom.bind(a)
mergePerson(b) // == b
b = {}
Object.assign(b, a) // == b
*/
```
[⬆ back to top](#table-of-contents) [⬆ back to top](#table-of-contents)
## Credits ## Credits

View File

@ -190,6 +190,9 @@
<a class="sublink-1" href="#uuidgenerator">UUIDGenerator</a> <a class="sublink-1" href="#uuidgenerator">UUIDGenerator</a>
<a class="sublink-1" href="#validatenumber">validateNumber</a> <a class="sublink-1" href="#validatenumber">validateNumber</a>
<h3>Uncategorized
</h3><a class="sublink-1" href="#flip">flip</a>
</nav><main class="col-sm-12 col-md-8 col-lg-9" style="height:100%;overflow-y:auto;background:#eceef2;padding:0"><a id="top">&nbsp;</a><h2 style="text-align:center">Adapter</h2> </nav><main class="col-sm-12 col-md-8 col-lg-9" style="height:100%;overflow-y:auto;background:#eceef2;padding:0"><a id="top">&nbsp;</a><h2 style="text-align:center">Adapter</h2>
<div class="card fluid"><div class="section double-padded"><h3 id="spreadover">spreadOver</h3></div><div class="section double-padded"> <div class="card fluid"><div class="section double-padded"><h3 id="spreadover">spreadOver</h3></div><div class="section double-padded">
<p>Takes a veriadic function and returns a closure that accepts an array of arguments to map to the inputs of the function.</p> <p>Takes a veriadic function and returns a closure that accepts an array of arguments to map to the inputs of the function.</p>
@ -1340,6 +1343,21 @@ Use <code>Number()</code> to check if the coercion holds.</p>
<pre><code class="language-js">const validateNumber = n =&gt; !isNaN(parseFloat(n)) &amp;&amp; isFinite(n) &amp;&amp; Number(n) == n; <pre><code class="language-js">const validateNumber = n =&gt; !isNaN(parseFloat(n)) &amp;&amp; isFinite(n) &amp;&amp; Number(n) == n;
// validateNumber('10') -&gt; true // validateNumber('10') -&gt; true
</code></pre> </code></pre>
</div></div><br/><h2 style="text-align:center">Uncategorized</h2>
<div class="card fluid"><div class="section double-padded"><h3 id="flip">flip</h3></div><div class="section double-padded">
<p>Flip takes a function as an argument, then makes the first argument the last</p>
<p>Return a closure that takes variadic inputs, and splices the last argument to make it the first argument before applying the rest.</p>
<pre><code class="language-js">const flip = fn =&gt; (...args) =&gt; fn(args.pop(), ...args)
/*
let a = {name: 'John Smith'}
let b = {}
const mergeFrom = flip(Object.assign)
let mergePerson = mergeFrom.bind(a)
mergePerson(b) // == b
b = {}
Object.assign(b, a) // == b
*/
</code></pre>
</div></div><br/> </div></div><br/>
<footer> <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> <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>

View File

@ -39,6 +39,7 @@ fibonacci:math
filterNonUnique:array filterNonUnique:array
flatten:array flatten:array
flattenDepth:array flattenDepth:array
flip:uncategorized
fromCamelCase:string fromCamelCase:string
functionName:function functionName:function
gcd:math gcd:math
@ -125,4 +126,3 @@ without:array
words:string words:string
zip:array zip:array
zipObject:array zipObject:array
flip:adapter