'use strict' module.exports = function pull (a) { var length = arguments.length if (typeof a === 'function' && a.length === 1) { var args = new Array(length) for(var i = 0; i < length; i++) args[i] = arguments[i] return function (read) { args.unshift(read) return pull.apply(null, args) } } var read = a if (read && typeof read.source === 'function') { read = read.source } for (var i = 1; i < length; i++) { var s = arguments[i] if (typeof s === 'function') { read = s(read) } else if (s && typeof s === 'object') { s.sink(read) read = s.source } } return read }