Skip to content

Instantly share code, notes, and snippets.

@ishiduca
Last active April 16, 2018 08:30
Show Gist options
  • Save ishiduca/59e7ed73d77eea9d399ea7e9e6554db9 to your computer and use it in GitHub Desktop.
Save ishiduca/59e7ed73d77eea9d399ea7e9e6554db9 to your computer and use it in GitHub Desktop.
var xtend = require('xtend')
module.exports = combine
function combine (a, b) {
return function () {
return xtend(a.apply(null, arguments), b.apply(null, arguments))
}
}
var combine = require('./combine')
var hasOwnProperty = Object.prototype.hasOwnProperty
module.exports = compose
function compose () {
var o = {}
for (var i = 0; i < arguments.length; i++) {
var a = arguments[i]
for (var p in a) {
if (hasOwnProperty(a, p)) {
o[p] = o[p] == null ? a[p] : combine(o[p], a[p])
}
}
}
return o
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment