Travis build: 114

This commit is contained in:
Travis CI
2017-12-22 14:11:44 +00:00
parent 778852df10
commit 1b2f349bb9
3 changed files with 44 additions and 1 deletions

View File

@ -161,6 +161,9 @@
* [`UUIDGenerator`](#uuidgenerator)
* [`validateNumber`](#validatenumber)
### _Uncategorized_
* [`flip`](#flip)
## Adapter
### spreadOver
@ -2203,6 +2206,28 @@ const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) ==
// 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)
## Credits