git ssb

2+

Dominic / pull-stream



Commit bb1bdb89523248804aace29fa3128944c6b432c3

export pull() as default

Dominic Tarr committed on 6/9/2013, 10:51:08 AM
Parent: ed03e36a93497fb87f78c4ab0933a1e1531ffd62

Files changed

index.jschanged
index.jsView
@@ -1,10 +1,28 @@
1-
21 var sources = require('./sources')
32 var sinks = require('./sinks')
43 var throughs = require('./throughs')
54 var u = require('pull-core')
65
6+function isThrough (fun) {
7+ return fun.type === "Through" || fun.length === 1
8+}
9+
10+var exports = module.exports = function pull () {
11+ var args = [].slice.call(arguments)
12+
13+ if(isThrough(args[0]))
14+ return function (read) {
15+ args.unshift(read)
16+ return pull.apply(null, args)
17+ }
18+
19+ var read = args.shift()
20+ while(args.length)
21+ read = args.shift() (read)
22+ return read
23+}
24+
725 for(var k in sources)
826 exports[k] = u.Source(sources[k])
927
1028 for(var k in throughs)

Built with git-ssb-web